Beispiel #1
0
        // GET: SuggetionList
        public ActionResult Index()
        {
            DataTable          dtExistingRecord     = new DataTable();
            DataTable          dtNewRecord          = new DataTable();
            UserDetails        objUserDetails       = new UserDetails();
            ContactSuggestions objContactSuggestion = new ContactSuggestions();

            dtExistingRecord = objUserDetails.GetBulkNotificationData().Tables[0];
            dtNewRecord      = objUserDetails.GetBulkNotificationData().Tables[1];
            IList <ResendNotification> itemsResendNotification = dtExistingRecord.AsEnumerable().Select(row =>
                                                                                                        new ResendNotification
            {
                UID                = row.Field <int>("UID"),
                DeviceUID          = row.Field <int>("DeviceUID"),
                Text               = row.Field <string>("Text"),
                NotificationType   = row.Field <string>("NotificationType"),
                NotificationTitle  = row.Field <string>("NotificationTitle"),
                Location           = row.Field <int?>("LocationId") == null? "": getlocationName(row.Field <int>("LocationId")),
                Sent               = row.Field <bool>("Sent"),
                Target             = row.Field <int?>("Target"),
                ScheduleTIme       = row.Field <DateTime?>("ScheduleTIme"),
                ConfirmTime        = row.Field <DateTime?>("ConfirmTime"),
                SubCategory        = row.Field <int?>("SubCategoryId"),
                Microcategory      = row.Field <int?>("MicrocategoryId"),
                TimeSent           = row.Field <DateTime?>("TimeSent"),
                IsDone             = row.Field <bool?>("IsDone"),
                IsDismissed        = row.Field <bool?>("IsDismissed"),
                RequestID          = row.Field <int?>("RequestID"),
                RedirectTo         = row.Field <string>("RedirectTo"),
                SentNotificationBy = row.Field <int?>("SentNotificationBy"),
                ContactId          = row.Field <int>("ContactId")
            }).ToList();

            IList <SentNotification> itemsSentNotification = dtExistingRecord.AsEnumerable().Select(row =>
                                                                                                    new SentNotification
            {
                ContactId                = row.Field <int>("ContactId"),
                Name                     = row.Field <string>("ContactName"),
                Number                   = row.Field <string>("ContactNumber"),
                SourceId                 = row.Field <int>("SourceId"),
                Source                   = Convert.ToString(GetSourceById(row.Field <int>("SourceId")).Rows[0]["Name"]),
                SourceNo                 = Convert.ToString(GetSourceById(row.Field <int>("SourceId")).Rows[0]["Mobile"]),
                HomeLocation             = row.Field <string>("LocationId1"),
                WorkLocation             = row.Field <string>("LocationId2"),
                CollegeSchoolLocation    = row.Field <string>("LocationId3"),
                ProfeDetails             = row.Field <string>("Comments"),
                AllowedRequestSuggestion = row.Field <bool>("AllowProvideSuggestion")
            }).ToList();

            objContactSuggestion.ResendNotificationList = itemsResendNotification;
            objContactSuggestion.SentNotificationList   = itemsSentNotification;
            //FillCategoryDrodown();
            //FillSubCate(Category);
            //FillMicroCate(SubCategory);
            //City();
            //BindSource();
            //FillContact(Source);
            //PlatformBind();
            //GetAreaDropdown(CityName,);
            return(View(objContactSuggestion));
        }