//public UserBusinessUnitSetup GetUserBusinessUnitSetupByID(int ID) //{ // return db.UserBusinessUnitSetups.Where(p => p.ID == ID).FirstOrDefault(); //} public IEnumerable <UserInformation> GetDropdownData(string AspNetUserId) { var userInfo = new UserInformationsController().GetUserByAspNetUserId(AspNetUserId); //db.UserInformations.Where(p =>p.IsActive == true || p.IsActive == null).ToList() var data = (from p in db.UserInformations where (userInfo.UserTypeID == 1 || p.Id == userInfo.Id) select p).ToList().OrderBy(p => p.UserFullName); return(data); }
public ActionResult PartialDasboard() { var _AspNetUserId = User.Identity.GetUserId(); var UserBasicInfo = new UserInformationsController().GetUserByAspNetUserId(_AspNetUserId); int id = UserBasicInfo.Id; var data = (from p in db.UserInformations.Where(p => p.Id == id) join a in db.AspNetUsers on p.AspNetUserId equals a.Id select new RegisterViewModel { Id = p.Id, AspNetUserId = p.AspNetUserId, AspNetRoleID = p.AspNetRoleID, UserName = a.UserName, UserFullName = p.UserFullName, Address = p.Address, Phone = p.PhoneNumber, OBranch = p.OfficeBranch, //PhoneNumber = p.PhoneNumber, //IsActive = p.IsActive, Password = p.UPassword, ConfirmPassword = p.UPassword, OldPassword = p.UPassword, Email = p.Email, FatherName = p.FatherName, MotherName = p.MotherName, SpouseName = p.SpouseName, UserPicture = p.UserPicture, DOB = p.DOB, EducationDetail = p.EducationDetail, MobileNo = p.MobileNo, BloodGroup = p.BloodGroup, Occupation = p.Occupation, NID = p.NID, District = p.District, IntroducerName = p.IntroducerName, IntroducerID = p.IntroducerID, NomineeName = p.NomineeName, NomineeRelation = p.NomineeRelation, NomineeAge = p.NomineeAge, NomineePicture = p.NomineePicture, DepositAmount = p.DepositAmount, AmountTransMobileNo = p.AmountTransMobileNo, BankName = p.BankName, AccountNo = p.AccountNo, }).FirstOrDefault(); return(PartialView(data)); }
public ActionResult Index(string UserID) { ////------------ if (ModelState.IsValid && Request.IsAuthenticated && Session["UserTypeID"] != null) { var userinfo = (UserInformation)Session["UserBasicInfo"]; //string aID = User.Identity.GetUserId(); string aID = userinfo.AspNetUserId; ViewBag.UserList = new SelectList(new UserInformationsController().GetDropdownData(aID), "ID", "UserFullName"); //var Dlist2 = db.ExportDocuments.ToList(); int _userid = ((UserID == null || UserID == "") ? 0 : Convert.ToInt32(UserID)); dynamic _userType = Session["UserTypeID"]; if (_userType != null && _userType != 1) { _userid = userinfo.Id; } Session["FilterByUserid"] = _userid; ////Column Chart: var _AspNetUserId = User.Identity.GetUserId(); var UserBasicInfo = new UserInformationsController().GetUserByAspNetUserId(_AspNetUserId); int id = UserBasicInfo.Id; var dataDashbord = GetMemberAccountingBalance(id); var data = (from p in db.UserInformations.Where(p => p.Id == id) join a in db.AspNetUsers on p.AspNetUserId equals a.Id select new RegisterViewModel { Id = p.Id, AspNetUserId = p.AspNetUserId, AspNetRoleID = p.AspNetRoleID, UserName = a.UserName, UserFullName = p.UserFullName, Address = p.Address, Phone = p.PhoneNumber, OBranch = p.OfficeBranch, //PhoneNumber = p.PhoneNumber, //IsActive = p.IsActive, Password = p.UPassword, ConfirmPassword = p.UPassword, OldPassword = p.UPassword, Email = p.Email, FatherName = p.FatherName, MotherName = p.MotherName, SpouseName = p.SpouseName, UserPicture = p.UserPicture, DOB = p.DOB, EducationDetail = p.EducationDetail, MobileNo = p.MobileNo, BloodGroup = p.BloodGroup, Occupation = p.Occupation, NID = p.NID, District = p.District, IntroducerName = p.IntroducerName, IntroducerID = p.IntroducerID, NomineeName = p.NomineeName, NomineeRelation = p.NomineeRelation, NomineeAge = p.NomineeAge, NomineePicture = p.NomineePicture, DepositAmount = p.DepositAmount, AmountTransMobileNo = p.AmountTransMobileNo, BankName = p.BankName, AccountNo = p.AccountNo, }).FirstOrDefault(); if (dataDashbord.UserID == 0) { dataDashbord.UserID = data.Id; dataDashbord.UserName = data.UserName; dataDashbord.UserFullName = data.UserFullName; } return(View(dataDashbord)); } else { return(View()); //return RedirectToAction("Index2", "Home"); //return RedirectToAction("Login", "Account"); } //return View(); }