Posts

Graph API implementation for getting AD Users in Office 365 - Show in Grid and set some filtration

Image
Main Functionality :- I want to get all AD Users from Office 365 and display it in grid with some filtration. If there is not login available then it will redirect to login page. Need to create new Azure Application and get ID of that app to set. Here is the full code for that.  <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> <head> </head> <body>     <style>         #myProgress {             width: 100%;             background-color: #ddd;         }         #myBar {             width: 00%;             height: 15px;             background-color: #C6006F;             text-align: center;          ...

Finding the Addition of Value from numbers of array

Now I want to get the numbers for which the given variable days is the sum of any digits in the array. For example  80 = 64+16 (if I/p is 80, O/P should be 64,16) 37 = 32 + 4 + 1 (If I/P is 37, O/P should be 32 , 4 , 1 ) Console.WriteLine("Enter Input:"); string input = Console.ReadLine(); double days = Convert.ToDouble(input); //short days = 80; short[] possibleDays = new short[] { 1, 2, 4, 8, 16, 32, 64 }; short sum = 0; string totalValues = string.Empty; for (int i = possibleDays.Length; i >= 1; i--) { sum += possibleDays[i - 1]; if (sum == days) { totalValues += possibleDays[i - 1] + ";"; break; } else { if (sum > days) { sum -= possibleDays[i - 1]; } else { totalValues += possibleDays[i - 1] + "'"; } } } totalValues = totalValues.TrimEnd(','); Console.WriteLine(totalValues); Console.ReadKey();

Export SharePoint list current View on Button Click

Get SharePoint List  SPList lst = web.Lists[listName]; Guid guid = new Guid(lst.ID); Get SharePoint List Current View SPViewCollection view = lst.Views; Guid viewGuid; foreach(SPView lstView in view) {    //Now View Name which you want to Export    if(lstView.Name == viewName)    {       viewGuid = new GUID( lstView.ID);      break;    } } Now Pass List and View GUID to below string and also pass SiteURL in it . Response.Redirect( siteUrl + " _vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={ListGuid}&View={ViewGUID}&CacheControl=1&RootFolder="); It will ask for Open or Save Exported List. Enjoy... -PP

Weekend Days Addition in Original Date with JavaScript

//Addition as per Weekend Days function AdditionDatePerWeekend(FromDate) {     var _previousDate = new Date(CurrentExpectedDate);     if (WeekendDays == 0) {         WeekendDays = IsWeekend(new Date(), CurrentExpectedDate);         var _tempNewDate = new Date(CurrentExpectedDate);         _tempNewDate.setDate(CurrentExpectedDate.getDate() + WeekendDays); //Add Weekend Days         WeekendDays = 0;         while (IsWeekend(_previousDate, _tempNewDate) > 0) {             WeekendDays = IsWeekend(_previousDate, _tempNewDate);             _previousDate = new Date(_tempNewDate);             var _tempDate = new Date(_tempNewDate);             _tempDate.setDate(_tempNewDate.getDate() + WeekendDays);             _...

Weekend Days Addition

         /// <param name="currentCountedDate">From Date</param>                    int _weekendDays = CountWeekendDays(DateTime.Today, currentCountedDate);             DateTime _responseDate = currentCountedDate;             DateTime _newDate = DateTime.Today;             if (_weekendDays > 0)             {                 _newDate = _responseDate.AddDays(_weekendDays);                 while (CountWeekendDays(_responseDate, _newDate) > 0)                 {                     int _count = CountWeekendDays(_responseDate, _newDate);                   ...