public string GetCreatedBy(Guid id)
        {
            UsersDetails result          = ent.UsersDetails.Where(x => x.UserId == id).FirstOrDefault();
            UsersDetails Createdbyresult = ent.UsersDetails.Where(x => x.AppUserId == result.CreatedBy).FirstOrDefault();

            return(Createdbyresult.FullName);
        }
Beispiel #2
0
        public void SaveUsers(UsersDetails userDetails)
        {
            Users dbUsers = context.Users.Find(userDetails.UserId);

            if (dbUsers != null)
            {
                dbUsers.UserId       = userDetails.UserId;
                dbUsers.UserName     = userDetails.UserName;
                dbUsers.UserPassword = userDetails.UserPassword;
                dbUsers.Email        = userDetails.Email;
                dbUsers.RoleId       = userDetails.RoleId;
            }
            else
            {
                Users user = new Users
                {
                    UserId       = Guid.NewGuid(),
                    UserName     = userDetails.UserName,
                    UserPassword = userDetails.UserPassword,
                    Email        = userDetails.Email,
                    RoleId       = userDetails.RoleId,
                };
                context.Users.Add(user);
            }
            context.SaveChanges();
        }
        public void Edit(int?id, BranchOfficeManagementModel model)
        {
            if (model.status == 0)
            {
                MembershipUser muUser = Membership.GetUser(model.UserName);
                pro.LockUserNow(model.UserName);
                Membership.UpdateUser(muUser);
            }
            else
            {
                MembershipUser muUser = Membership.GetUser(model.UserName);
                Membership.GetUser(model.UserName).UnlockUser();
                muUser.Email = model.Email;

                Membership.UpdateUser(muUser);

                UsersDetails usersDetails = ent.UsersDetails.Where(x => x.UserId == (Guid)muUser.ProviderUserKey).FirstOrDefault();
                if (usersDetails != null)
                {
                    usersDetails.MobileNumber = model.MobileNo;
                    usersDetails.PhoneNumber  = model.UserPhone;
                    usersDetails.UserAddress  = model.UserAddress;

                    ent.ApplyCurrentValues(usersDetails.EntityKey.EntitySetName, usersDetails);
                    ent.SaveChanges();
                }
            }

            EditBranchOfficeManagement(model);
        }
Beispiel #4
0
        public APIResponse UpdateUserDetail(UsersDetails usersDetails)
        {
            APIResponse response = new APIResponse();

            dateTime        = DateTime.UtcNow.AddHours(5).AddMinutes(30);
            response.Result = false;
            try
            {
                using (DBEntities testEngineEntities = new DBEntities())
                {
                    var data = testEngineEntities.UserDetailMasters.Where(x => x.Id == usersDetails.Id && x.IsDeleted == false).FirstOrDefault();
                    if (data != null)
                    {
                        data.UserTitle    = usersDetails.UserTitleName;
                        data.ModifiedDate = dateTime;
                        testEngineEntities.SaveChanges();
                        response.Result = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }
Beispiel #5
0
        public List <UsersDetails> GetUsersList()
        {
            List <UsersDetails> detaillist        = new List <UsersDetails>();
            UserManagementDAL   userManagementDAL = new UserManagementDAL();

            try
            {
                var data = userManagementDAL.GetUsersList();
                if (data.Count > 0)
                {
                    data.ForEach(x =>
                    {
                        UsersDetails detail     = new UsersDetails();
                        detail.Id               = x.Id;
                        detail.UserTitleName    = x.UserTitle;
                        detail.CreatedDateTime  = x.CreatedDate.ToString();
                        detail.ModifiedDateTime = x.ModifiedDate.ToString();
                        detaillist.Add(detail);
                    });
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(detaillist);
        }
        public ActionResponse EditDistributedManagement(DistributorManagementModel model)
        {
            if (model.DistributorId == 0)
            {
                _res.ActionMessage  = String.Format(Resources.Message.InvalidOperation, "Distributor");
                _res.ErrNumber      = 1005;
                _res.ErrSource      = "DataBase";
                _res.ErrType        = "App";
                _res.ResponseStatus = true;
                goto End;
            }
            var obj = entity.Distributors.Where(x => x.DistributorId == model.DistributorId).FirstOrDefault();

            if (obj == null)
            {
                _res.ActionMessage  = String.Format(Resources.Message.InvalidOperation, "Distributor");
                _res.ErrNumber      = 1005;
                _res.ErrSource      = "DataBase";
                _res.ErrType        = "App";
                _res.ResponseStatus = true;
                goto End;
            }

            if (model.Status == 0) ///If select status is deactive then Lockuser
            {
                MembershipUser muUser = Membership.GetUser(model.UserName);
                pro.LockUserNow(model.UserName);
                Membership.UpdateUser(muUser);
            }
            else
            {
                MembershipUser muUser = Membership.GetUser(model.UserName);
                Membership.GetUser(model.UserName).UnlockUser();
                muUser.Email = model.UserEmail;

                Membership.UpdateUser(muUser);

                UsersDetails usersDetails = entity.UsersDetails.Where(x => x.UserId == (Guid)muUser.ProviderUserKey).FirstOrDefault();
                if (usersDetails != null)
                {
                    usersDetails.MobileNumber = model.UserMobileNo;
                    usersDetails.PhoneNumber  = model.UserPhoneNo;
                    usersDetails.UserAddress  = model.UserAddress;

                    entity.ApplyCurrentValues(usersDetails.EntityKey.EntitySetName, usersDetails);
                    entity.SaveChanges();
                }
            }
            UpdateDistributor(model);
            UpdateGeneralLegder(model);//Ledger Entry

            _res.ActionMessage  = String.Format(Resources.Message.SuccessfullyUpdated, "Distributor");
            _res.ErrNumber      = 0;
            _res.ResponseStatus = true;
            goto End;

End:
            return(_res);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            UsersDetails usersDetails = db.UsersDetails.Find(id);

            db.UsersDetails.Remove(usersDetails);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #8
0
        public void UpdateUserDetailsInfo(UsersDetails table)
        {
            UsersDetails tu = db.UsersDetails.Where(u => u.UserId == table.UserId).FirstOrDefault();

            tu.UserId = table.UserId;
            db.ApplyCurrentValues(tu.EntityKey.EntitySetName, table);
            db.SaveChanges();
            /////
        }
 public ActionResult Edit([Bind(Include = "ID,UserName,UserMail,IsPromotor,IsStudent,IsAdmin")] UsersDetails usersDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(usersDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(usersDetails));
 }
        public ActionResult Create([Bind(Include = "ID,UserName,UserMail,IsPromotor,IsStudent,IsAdmin")] UsersDetails usersDetails)
        {
            if (ModelState.IsValid)
            {
                db.UsersDetails.Add(usersDetails);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(usersDetails));
        }
Beispiel #11
0
        public APIResponse UploadUserDetail(UsersDetails usersDetails)
        {
            UsersDetailsModel details  = new UsersDetailsModel();
            APIResponse       response = new APIResponse();

            try
            {
                using (TestEngineEntities testEngineEntities = new TestEngineEntities())
                {
                    UserDetailMaster users = new UserDetailMaster();
                    users.Id           = Guid.NewGuid();
                    users.UserTitle    = usersDetails.UserTitleName;
                    users.CreatedDate  = DateTime.Now;
                    users.ModifiedDate = DateTime.Now;
                    users.IsDeleted    = false;
                    testEngineEntities.UserDetailMasters.Add(users);

                    foreach (var item in usersDetails.UsersDetailsModel)
                    {
                        DefaultRegistation defaultRegistation = new DefaultRegistation();
                        defaultRegistation.ID            = Guid.NewGuid();
                        defaultRegistation.UserDetailId  = users.Id;
                        defaultRegistation.Name          = item.Name;
                        defaultRegistation.Email         = item.Email;
                        defaultRegistation.MobileNumber  = item.MobileNumber;
                        defaultRegistation.Degree        = item.Degree;
                        defaultRegistation.Institution   = item.Institution;
                        defaultRegistation.Major         = item.Major;
                        defaultRegistation.Percentage    = item.Percentage;
                        defaultRegistation.Gender        = item.Gender;
                        defaultRegistation.Address       = item.Address;
                        defaultRegistation.CustomField1  = item.CustomField1;
                        defaultRegistation.CustomField2  = item.CustomField2;
                        defaultRegistation.CustomField3  = item.CustomField3;
                        defaultRegistation.CustomField4  = item.CustomField4;
                        defaultRegistation.CustomField5  = item.CustomField5;
                        defaultRegistation.CustomField6  = item.CustomField6;
                        defaultRegistation.CustomField7  = item.CustomField7;
                        defaultRegistation.CustomField8  = item.CustomField8;
                        defaultRegistation.CustomField9  = item.CustomField9;
                        defaultRegistation.CustomField10 = item.CustomField10;
                        testEngineEntities.DefaultRegistations.Add(defaultRegistation);
                    }
                    testEngineEntities.SaveChanges();
                    response.Result = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(response);
        }
        public void EditUserInfo(B2CUserManagementModel model)
        {
            UsersDetails result = ent.UsersDetails.Where(x => x.UserId == model.UserId).FirstOrDefault();

            result.UserAddress  = model.Address;
            result.PhoneNumber  = model.Phone;
            result.MobileNumber = model.Mobile;
            result.FullName     = model.FullName;

            ent.ApplyCurrentValues(result.EntityKey.EntitySetName, result);
            ent.SaveChanges();
        }
Beispiel #13
0
 public APIResponse UpdateUserDetail(UsersDetails usersDetails)
 {
     try
     {
         response = userManagementBLL.UpdateUserDetail(usersDetails);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(response);
 }
Beispiel #14
0
 public ActionResult SaveUsers(UsersDetails userDetails)
 {
     if (ModelState.IsValid)
     {
         EntityRepository.SaveUsers(userDetails);
         TempData["message"] = string.Format("User has been saved");
         return(RedirectToAction("List", new { type = "Users" }));
     }
     else
     {
         return(RedirectToAction("List", new { type = "Users" }));
     }
 }
Beispiel #15
0
        // ***********************************************************************************
        ////// Setting of session For Specific user login
        // ***********************************************************************************
        public void SetSessionsObject(Guid userId)
        {
            Agents        ainfo = null;
            TravelSession obj   = new TravelSession();
            aspnet_Users  tu    = GetUserInfo(userId);

            try
            {
                ainfo = GetAgentInfo(tu.UserId);
            }
            catch (Exception)
            {
            }

            UsersDetails udinfo = GetUserDetailsInfo(userId);

            if (udinfo.UserTypeId == 5)
            {
                BranchOfficeManagementProvider branchOfficeManagementProvider = new BranchOfficeManagementProvider();
                View_BranchDetails             branchOffices = branchOfficeManagementProvider.GetBranchOfficeByUserId(userId);

                obj.LoginTypeName = branchOffices.BranchOfficeName;
                obj.AgentCode     = branchOffices.BranchOfficeName;
                obj.LoginTypeId   = branchOffices.BranchOfficeId;
            }
            else if (udinfo.UserTypeId == 6)
            {
                DistributorManagementProvider distributorManagementProvider = new DistributorManagementProvider();
                View_DistributorDetails       distributors = distributorManagementProvider.GetDistributorByUserId(userId);

                obj.LoginTypeName = distributors.DistributorName;
                obj.AgentCode     = distributors.DistributorName;
                obj.LoginTypeId   = distributors.DistributorId;
            }
            else if (udinfo.UserTypeId == 7)
            {
                obj.Id         = userId;
                obj.LoginName  = tu.UserName;
                obj.AppUserId  = udinfo.AppUserId;
                obj.UserTypeId = udinfo.UserTypeId;
                obj.ProductId  = GetUserProductId(obj.AppUserId);
            }

            obj.Id         = userId;
            obj.LoginName  = tu.UserName;
            obj.AppUserId  = udinfo.AppUserId;
            obj.UserTypeId = udinfo.UserTypeId;
            obj.ProductId  = GetUserProductId(obj.AppUserId);

            HttpContext.Current.Session["TravelPortalSessionInfo"] = obj;
        }
Beispiel #16
0
        public UsersDetails UserDetailEdit(Guid?UserDetailId)
        {
            UsersDetails detailsView = new UsersDetails();

            try
            {
                detailsView = userManagementBLL.UserDetailEdit(UserDetailId);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(detailsView);
        }
        // GET: UsersDetails/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UsersDetails usersDetails = db.UsersDetails.Find(id);

            if (usersDetails == null)
            {
                return(HttpNotFound());
            }
            return(View(usersDetails));
        }
        public virtual RedirectToRouteResult UpdateDetails(string ProviderUserKey)
        {
            Guid         userId  = new Guid(ProviderUserKey);
            var          user    = Membership.GetUser(userId);
            UsersDetails details = ser.GetUserDetails(userId);

            details.UserId       = userId;
            details.FullName     = Request.Form["FullName"];
            details.UserAddress  = Request.Form["Address"];
            details.MobileNumber = Request.Form["MobileNo"];
            details.PhoneNumber  = Request.Form["PhoneNo"];
            details.AppUserId    = details.AppUserId;
            ser.UpdateUserDetailsInfo(details);
            return(RedirectToUserPage(user));
        }
Beispiel #19
0
        public APIResponse UploadUserDetail(UsersDetails usersDetails)
        {
            UsersDetailsModel details           = new UsersDetailsModel();
            UserManagementDAL userManagementDAL = new UserManagementDAL();

            try
            {
                response = userManagementDAL.UploadUserDetail(usersDetails);
            }
            catch (Exception)
            {
                throw;
            }
            return(response);
        }
Beispiel #20
0
        public ActionResult UpdateUserDetail(UsersDetails usersDetails)
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(apiUrl);
                var result = client.PostAsJsonAsync(apiUrl + "/UserManagement/UpdateUserDetail", usersDetails).Result;
                if (result.IsSuccessStatusCode)
                {
                    var Result = result.Content.ReadAsStringAsync().Result;

                    APIResponse = JsonConvert.DeserializeObject <APIResponse>(Result);
                }
            }
            return(Json(APIResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #21
0
        public void EditUserInfo(AdminUserManagementModel.CreateAdminAspUser model)
        {
            UsersDetails result = db.UsersDetails.Where(x => x.UserId == model.UserId).FirstOrDefault();


            result.UserTypeId = (model.IsSalesMarketingUser != true ? ((int)ATLTravelPortal.Helpers.UserTypes.BackofficeUser) : ((int)ATLTravelPortal.Helpers.UserTypes.MEs));

            result.UserAddress  = model.UserInfo.UserAddress;
            result.PhoneNumber  = model.UserInfo.PhoneNumber;
            result.MobileNumber = model.UserInfo.MobileNumber;
            result.FullName     = model.UserInfo.FullName;

            db.ApplyCurrentValues(result.EntityKey.EntitySetName, result);
            db.SaveChanges();
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("WelcomePage.aspx");
            }
            else
            {
                username = Session["username"].ToString();
                Session.RemoveAll();
            }

            string wsUrl = "http://localhost:63420/SensorMonitoringSystemService.svc";

            var GetUserClient = new WebClient();
            var JsonFoundUser = GetUserClient.DownloadString(wsUrl + "/rest/finduser/" + username);
            var FoundUser     = JsonHelper.Deserialize <Users>(JsonFoundUser);
            LoggedUser = FoundUser;

            var GetUserDetailClient = new WebClient();
            var JsonFoundUserDetail = GetUserClient.DownloadString(wsUrl + "/rest/finduserdetail/" + FoundUser.UserID.ToString());
            var FoundUserDetail     = JsonHelper.Deserialize <UsersDetails>(JsonFoundUserDetail);
            LoggedUserDetail = FoundUserDetail;

            var SurnameEnglish = FoundUser.Surname.ToUpper();

            if (SurnameEnglish.Contains('İ'))
            {
                SurnameEnglish = SurnameEnglish.Replace('İ', 'I');
            }

            Dearlbl.Text = "Welcome Dear " + SurnameEnglish;

            var GetSensorsClient = new WebClient();
            var JsonFoundSensors = GetSensorsClient.DownloadString(wsUrl + "/rest/findallsensors/" + FoundUser.CompanyID.ToString());
            var FoundSensors     = JsonHelper.Deserialize <List <Sensors> >(JsonFoundSensors);

            foreach (Sensors Sensor in FoundSensors)
            {
                Sensorsddl.Items.Add(Sensor.SensorDescription);
                AllSensors.Add(Sensor);
            }

            SensorAddresslbl.Text = AllSensors[0].SensorAddress;
        }
    }
Beispiel #23
0
        public UsersDetails UserDetailEdit(Guid?UserDetailId)
        {
            UsersDetails detail = new UsersDetails();

            try
            {
                var data = userManagementDAL.UserDetailEdit(UserDetailId);
                detail.Id            = data.Id;
                detail.UserTitleName = data.UserTitle;
            }
            catch (Exception)
            {
                throw;
            }
            return(detail);
        }
Beispiel #24
0
        public ActionResult UserDetailEdit(Guid?UserDetailId)
        {
            UsersDetails usersDetails = new UsersDetails();

            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri(apiUrl);
                var result = client.GetAsync(apiUrl + "/UserManagement/UserDetailEdit?UserDetailId=" + UserDetailId).Result;
                if (result.IsSuccessStatusCode)
                {
                    var Result = result.Content.ReadAsStringAsync().Result;

                    usersDetails = JsonConvert.DeserializeObject <UsersDetails>(Result);
                }
            }
            return(Json(usersDetails, JsonRequestBehavior.AllowGet));
        }
        public bool CheckEditDuplicateMobileNumber(string MobileNumber, int BranchUserId)
        {
            View_BranchDetails View_BranchDetails = ent.View_BranchDetails.Where(ii => ii.BranchOfficeId == BranchUserId).FirstOrDefault();

            if (View_BranchDetails != null)
            {
                UsersDetails usersDetails = ent.UsersDetails.Where(ii => ii.MobileNumber == MobileNumber && ii.UserId != View_BranchDetails.UserId).FirstOrDefault();

                if (usersDetails != null)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            return(false);
        }
        public ActionResult Delete(Guid id)
        {
            try
            {
                TravelPortalEntity.EntityModel ent = new EntityModel();
                UsersDetails userDetails           = ent.UsersDetails.Where(x => x.UserId == id).FirstOrDefault();

                List <Core_UserProducts> userprod = ent.Core_UserProducts.Where(x => x.UserId == userDetails.AppUserId).ToList();
                if (userprod != null)
                {
                    foreach (var item in userprod)
                    {
                        Core_UserProducts data = item;
                        if (data != null)
                        {
                            ent.DeleteObject(data);
                            ent.SaveChanges();
                        }
                    }
                }

                if (userDetails != null)
                {
                    ent.DeleteObject(userDetails);
                    ent.SaveChanges();
                }

                List <LoginHistories> loginResult = ent.LoginHistories.Where(x => x.UserId == id).ToList();

                foreach (var item in loginResult)
                {
                    LoginHistories rec = item;
                    ent.DeleteObject(rec);
                    ent.SaveChanges();
                }

                aspnet_Users user = ent.aspnet_Users.Where(x => x.UserId == id).FirstOrDefault();
                Membership.DeleteUser(user.UserName, true);
            }
            catch
            { }
            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(Guid id)
        {
            try
            {
                TravelPortalEntity.EntityModel ent = new EntityModel();
                UsersDetails userDetails           = ent.UsersDetails.Where(x => x.UserId == id).FirstOrDefault();

                if (userDetails != null)
                {
                    ent.DeleteObject(userDetails);
                    ent.SaveChanges();
                }

                aspnet_Users user = ent.aspnet_Users.Where(x => x.UserId == id).FirstOrDefault();
                Membership.DeleteUser(user.UserName, true);
            }
            catch
            {
                TempData["InfoMessage"] = "Cannot delete the user.";
            }
            return(RedirectToAction("Index"));
        }
        public ActionResult UploadUserDetail(string UserNameTitle)
        {
            string Result = "Failed";

            APIResponse response = new APIResponse();

            foreach (string file in Request.Files)
            {
                HttpPostedFileBase hpf           = Request.Files[file] as HttpPostedFileBase;
                string             fileextension = Path.GetExtension(hpf.FileName);
                var UsersDetail = new UsersDetails();
                if (fileextension == ".xlsx" || fileextension == ".xls" || fileextension == ".csv")
                {
                    var          dt           = Common.ConvertFileToDateTable(hpf, "UserDetailsUploadFile");
                    UsersDetails usersDetails = new UsersDetails();
                    usersDetails.UsersDetailsModel = new List <UsersDetailsModel>();
                    List <UsersDetailsModel> userslist = new List <UsersDetailsModel>();
                    usersDetails.UserTitleName = UserNameTitle;
                    var rowCount = dt.Rows.Count;
                    for (int i = 0; i < rowCount; i++)
                    {
                        UsersDetailsModel UsersDetails = new UsersDetailsModel();
                        UsersDetails.Name          = dt.Rows[i]["Name"] != DBNull.Value ? dt.Rows[i]["Name"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.Email         = dt.Rows[i]["Email"] != DBNull.Value ? dt.Rows[i]["Email"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.MobileNumber  = dt.Rows[i]["MobileNumber"] != DBNull.Value ? dt.Rows[i]["MobileNumber"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.Degree        = dt.Rows[i]["Degree"] != DBNull.Value ? dt.Rows[i]["Degree"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.Institution   = dt.Rows[i]["Institution"] != DBNull.Value ? dt.Rows[i]["Institution"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.Major         = dt.Rows[i]["Major"] != DBNull.Value ? dt.Rows[i]["Major"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.Percentage    = dt.Rows[i]["Percentage"] != DBNull.Value ? dt.Rows[i]["Percentage"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.Gender        = dt.Rows[i]["Gender"] != DBNull.Value ? dt.Rows[i]["Gender"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.Address       = dt.Rows[i]["Address"] != DBNull.Value ? dt.Rows[i]["Address"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField1  = dt.Rows[i]["CustomField1"] != DBNull.Value ? dt.Rows[i]["CustomField1"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField2  = dt.Rows[i]["CustomField2"] != DBNull.Value ? dt.Rows[i]["CustomField2"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField3  = dt.Rows[i]["CustomField3"] != DBNull.Value ? dt.Rows[i]["CustomField3"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField4  = dt.Rows[i]["CustomField4"] != DBNull.Value ? dt.Rows[i]["CustomField4"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField5  = dt.Rows[i]["CustomField5"] != DBNull.Value ? dt.Rows[i]["CustomField5"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField6  = dt.Rows[i]["CustomField6"] != DBNull.Value ? dt.Rows[i]["CustomField6"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField7  = dt.Rows[i]["CustomField7"] != DBNull.Value ? dt.Rows[i]["CustomField7"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField8  = dt.Rows[i]["CustomField8"] != DBNull.Value ? dt.Rows[i]["CustomField8"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField9  = dt.Rows[i]["CustomField9"] != DBNull.Value ? dt.Rows[i]["CustomField9"].ToString().Trim().ToUpper() : string.Empty;
                        UsersDetails.CustomField10 = dt.Rows[i]["CustomField10"] != DBNull.Value ? dt.Rows[i]["CustomField10"].ToString().Trim().ToUpper() : string.Empty;

                        if (UsersDetails != null)
                        {
                            userslist.Add(UsersDetails);
                        }
                    }

                    usersDetails.UsersDetailsModel = userslist;
                    if (usersDetails.UsersDetailsModel.Any())
                    {
                        using (var client = new HttpClient())
                        {
                            client.BaseAddress = new Uri(apiUrl);
                            var result = client.PostAsJsonAsync(apiUrl + "/UserManagement/UploadUserDetail", usersDetails).Result;
                            if (result.IsSuccessStatusCode)
                            {
                                Result = result.Content.ReadAsStringAsync().Result;

                                response = JsonConvert.DeserializeObject <APIResponse>(Result);
                            }
                        }
                    }
                }
            }
            return(Json(new { data = response }));
        }
Beispiel #29
0
 public JsonResult DeleteUserNotificationList(int notificationId)
 {
     _detail = new UsersDetails();
     return(Json(ReturnAjaxAlertMessage(_detail.DeleteUserNotificationList(notificationId)).ToList(), JsonRequestBehavior.AllowGet));
 }
Beispiel #30
0
 public JsonResult GetUserNotificationList()
 {
     _detail = new UsersDetails();
     return(Json(_detail.GetUserNotificationList(), JsonRequestBehavior.AllowGet));
 }