public IActionResult Index() { var isLogin = HttpContext.Session.GetString("isUserLogin"); if (isLogin == "true") { return(View(_branchService.GetAll())); } return(RedirectToAction("Login", "Home")); }
public ActionResult Create(int?id) { var viewModel = new UserViewModel { Branches = branchService.GetAll(), Roles = userService.GetRoles(), Id = id ?? 0 }; return(View(viewModel)); }
public IActionResult Create() { var isLogin = HttpContext.Session.GetString("isUserLogin"); if (isLogin == "true") { var model = new DeliveryAddModel(); model.BranchList = _branchService.GetAll(); model.ProductList = _productService.GetAll(); return View(model); } return RedirectToAction("Login", "Home"); }
public ActionResult Edit(int id) { // For Bind Company #region Company Bind List <CompanyItem> objCompany = new List <CompanyItem>(); CompanyService objListCompany = new CompanyService(); objCompany = objListCompany.GetALL(); EmpWorkHistoryItem objEmpWorkHistoryItem = new EmpWorkHistoryItem(); objEmpWorkHistoryItem.CompanyList = new List <CompanyItem>(); objEmpWorkHistoryItem.CompanyList.AddRange(objCompany); #endregion //For Bind Branch #region Bind Branch List <BranchItem> objbranchitm = new List <BranchItem>(); BranchService objbranchservice = new BranchService(); objbranchitm = objbranchservice.GetAll(); //objEmpItem = new EmployeeItem(); objEmpWorkHistoryItem.BranchList = new List <BranchItem>(); objEmpWorkHistoryItem.BranchList.AddRange(objbranchitm); // for designation ddl WorkHistoryService objWorkHistoryService = new WorkHistoryService(); objEmpWorkHistoryItem = objWorkHistoryService.GetByPk(id); #endregion return(View(objEmpWorkHistoryItem)); }
public ActionResult Create() { // For Bind Company #region Company Bind List <CompanyItem> objCompany = new List <CompanyItem>(); CompanyService objListCompany = new CompanyService(); objCompany = objListCompany.GetALL(); EmpWorkHistoryItem objEmpWorkHistoryItem = new EmpWorkHistoryItem(); objEmpWorkHistoryItem.CompanyList = new List <CompanyItem>(); objEmpWorkHistoryItem.CompanyList.AddRange(objCompany); #endregion //For Bind Branch #region Bind Branch List <BranchItem> objbranchitm = new List <BranchItem>(); BranchService objbranchservice = new BranchService(); objbranchitm = objbranchservice.GetAll(); //objEmpItem = new EmployeeItem(); objEmpWorkHistoryItem.BranchList = new List <BranchItem>(); objEmpWorkHistoryItem.BranchList.AddRange(objbranchitm); // for designation ddl clsMasterDataMethod objclsMasterDataMethod = new clsMasterDataMethod(); objEmpWorkHistoryItem.DesignationList = objclsMasterDataMethod.GetAllDesignation(); objEmpWorkHistoryItem.EmpId = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); #endregion return(View(objEmpWorkHistoryItem)); }
//[HttpPost] //public ActionResult Create(EmployeeItem model) //{ // if (model.Empname != null) // { // EmployeeService objEmpService = new EmployeeService(); // HttpPostedFileBase file = Request.Files["file"]; // var fileName = Path.GetFileName(file.FileName); // var path = Path.Combine(Server.MapPath("../PhotoUpload"), fileName); // file.SaveAs(path); // model.Photo = fileName; // model.CreatedDate = System.DateTime.Now; // int p = objEmpService.Insert(model); // return RedirectToAction("Create", "Employee"); // } // else // { // ModelState.AddModelError("", ""); // return RedirectToAction("Create", "Employee"); // } //} public ActionResult View(int id) { EmployeeService objmethod = new EmployeeService(); EmployeeItem objmaster = new EmployeeItem(); objmaster = objmethod.GetById(id); Session["PhotoId"] = objmaster.Photo; List <EmployeeItem> lstmasterp = new List <EmployeeItem>(); objmaster.EmployeeList = new List <EmployeeItem>(); objmaster.EmployeeList.AddRange(lstmasterp); //Added by Kuldip Patel @07-06-2016 #region Bind RDB Working Status List <clsMasterData> lstMasters1 = new List <clsMasterData>(); EmployeeService objclsmethod = new EmployeeService(); lstMasters1 = objclsmethod.GetWorkingStatus(); EmployeeItem objItem = new EmployeeItem(); objmaster.listMasterWS = new List <clsMasterData>(); objmaster.listMasterWS.AddRange(lstMasters1); #endregion #region Company Bind List <CompanyItem> objCompany = new List <CompanyItem>(); CompanyService objListCompany = new CompanyService(); objCompany = objListCompany.GetALL(); objmaster.CompanyList = new List <CompanyItem>(); objmaster.CompanyList.AddRange(objCompany); #endregion //For Bind Branch #region Bind Branch List <BranchItem> objbranchitm = new List <BranchItem>(); BranchService objbranchservice = new BranchService(); objbranchitm = objbranchservice.GetAll(); //objEmpItem = new EmployeeItem(); objmaster.BranchList = new List <BranchItem>(); objmaster.BranchList.AddRange(objbranchitm); #endregion //ViewBag.EmpId = id; //EmployeeService objEMP = new EmployeeService(); //string s; //s = objEMP.getEMP(id); //ViewBag.EmpName = s; EmpAllItem objAllItem = new EmpAllItem(); objAllItem.EmployeeItem = objmaster; return(View(objAllItem)); }
protected override ItemViewModel SetViewModelData(ItemViewModel viewModel) { //branch select list items BranchService branchService = new BranchService(UnitOfWork); viewModel.BranchSelectListItems = branchService.GetAll().ToList().Select(o => new SelectListItem { Text = o.Name, Value = o.Id.ToString() }).ToList(); return(viewModel); }
public static IEnumerable<SelectListItem> FillddlBranch() { var service = new BranchService(); var branch = service.GetAll(); var listitems = branch.Select(x => new SelectListItem { Text = x.BranchName, Value = x.Id.ToString() }); return listitems; }
public void GetAll_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new BranchRepository(context); var service = new BranchService(repository); // Act IEnumerable <BranchModel> result = service.GetAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(context.branch.Count(), result.Count()); }
public static IEnumerable <SelectListItem> FillddlBranch() { var service = new BranchService(); var branch = service.GetAll(); var listitems = branch.Select(x => new SelectListItem { Text = x.BranchName, Value = x.Id.ToString() }); return(listitems); }
public ActionResult CreateEmployee(string ID) { int EmployeeId = string.IsNullOrEmpty(ID.DecryptString()) ? default(int) : Convert.ToInt32(ID.DecryptString()); #region Dropdowwn Binding EmployeeDto objEmployeeDto = new EmployeeDto(); List <BranchDto> BranchDto = _branchService.GetAll(); SelectList branchSelectList = new SelectList(BranchDto, "BranchID", "BranchCode", "Select BranchCode"); ViewBag.BranchCode = branchSelectList; List <ClusterDto> clusterSelectList = _ClusterService.GetAll(); SelectList lStClusters = new SelectList(clusterSelectList, "ClusterID", "ClusterName", objEmployeeDto.ClusterID); ViewBag.clusters = lStClusters; SelectList educationQualification = GetDropDownListByMasterCode(Enums.RefMasterCodes.EDUCATION_QUALIFICATION); ViewBag.educationQualification = educationQualification; SelectList socialCategory = GetDropDownListByMasterCode(Enums.RefMasterCodes.SOCIAL_CATEGORY); ViewBag.socialCategory = socialCategory; SelectList bankName = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_NAME); ViewBag.bankName = bankName; SelectList AccountType = GetDropDownListByMasterCode(Enums.RefMasterCodes.BANK_ACCOUNT_TYPE); ViewBag.AhType = AccountType; SelectList Religion = GetDropDownListByMasterCode(Enums.RefMasterCodes.RELIGION); ViewBag.Religion = Religion; SelectList Desigination = GetDropDownListByMasterCode(Enums.RefMasterCodes.DESIGNATION); ViewBag.Desigination = Desigination; SelectList BloodGroup = GetDropDownListByMasterCode(Enums.RefMasterCodes.BLOODGROUP); ViewBag.BloodGroup = BloodGroup; SelectList nomineeRelationship = GetDropDownListByMasterCode(Enums.RefMasterCodes.NOMINEE_RELATIONSHIP); ViewBag.nomineeRelationship = nomineeRelationship; SelectList parentGuardionRelationship = GetDropDownListByMasterCode(Enums.RefMasterCodes.PARENT_GUARDIAN_RELATIONSHIP); ViewBag.parentGuardionRelationship = parentGuardionRelationship; ViewBag.familyIncome = GetDropDownListByMasterCode(Enums.RefMasterCodes.MONTHLY_INCOME); var roleSelectListDto = _employeeService.GetRoleSelectList(); var roleSelectList = new SelectList(roleSelectListDto, "ID", "Text", objEmployeeDto.RoleId); ViewBag.roles = roleSelectList; #endregion Dropdowwn Binding if (EmployeeId > 0) { objEmployeeDto = _employeeService.GetByID(EmployeeId); } EmployeeModel employeeModel = Mapper.Map <EmployeeDto, EmployeeModel>(objEmployeeDto); FillEmployeeKYC(ref employeeModel); if (employeeModel.EmployeeID > 0) { JsonResult BranchData = GetBranchName(objEmployeeDto.BranchID); employeeModel.BranchName = BranchData.Data.GetType().GetProperty("BranchName").GetValue(BranchData.Data, null).ToString(); } if (EmployeeId > 0) { int employeeid = objEmployeeDto.BranchID; ViewBag.EmployeeId = employeeid; if (UserInfo.UserID == employeeid) { UserInfo.Photo = employeeModel.Photo; UserInfo.UserName = employeeModel.EmployeeName; } } return(View(employeeModel)); }
// GET: Branches public ActionResult Index() { var branch = Service.GetAll(); return(View(branch)); }
public ActionResult Index() { var data = branchService.GetAll(); return(View(data)); }
//public ActionResult Index(int employeeId) //{ // //Using this parameter we have to use employee id instead of session to remove concurrency conflict because for each update of details route will be lie // // ConterollerName/ActionName/EmployeeId // //Any question? // return new RedirectResult("DashboardController/{EmployeeId}"); //} public ActionResult Create() { // For Bind Company #region Company Bind List <CompanyItem> objCompany = new List <CompanyItem>(); CompanyService objListCompany = new CompanyService(); objCompany = objListCompany.GetALL(); EmployeeItem objEmpItem = new EmployeeItem(); objEmpItem.CompanyList = new List <CompanyItem>(); objEmpItem.CompanyList.AddRange(objCompany); #endregion //For Bind Branch #region Bind Branch List <BranchItem> objbranchitm = new List <BranchItem>(); BranchService objbranchservice = new BranchService(); objbranchitm = objbranchservice.GetAll(); //objEmpItem = new EmployeeItem(); objEmpItem.BranchList = new List <BranchItem>(); objEmpItem.BranchList.AddRange(objbranchitm); EmpAllItem objAllItem = new EmpAllItem(); objAllItem.EmployeeItem = objEmpItem; #endregion //var tuple = new Tuple<EmployeeItem, EmpRelativeItem>(objEmpItem, new EmpRelativeItem()); //For Bind CountryList EmpContactItem objContact = new EmpContactItem(); EmployeeService objServiceEmp = new EmployeeService(); #region Country Bind List <CountryItem> objCountry = new List <CountryItem>(); objServiceEmp = new EmployeeService(); objCountry = objServiceEmp.CountryList(); objContact = new EmpContactItem(); objContact.CountryList = new List <CountryItem>(); objContact.CountryList.AddRange(objCountry); objAllItem.EmpContactItem = objContact; #endregion //bind Jobtitle #region Bind DropDown Jobtitle List <clsMasterData> lstMasters1 = new List <clsMasterData>(); EmployeeService objclsmethod = new EmployeeService(); lstMasters1 = objclsmethod.GetJobTitle(); EmployeeItem objItem = new EmployeeItem(); objAllItem.listMaster = new List <clsMasterData>(); objAllItem.listMaster.AddRange(lstMasters1); #endregion // For bind Relation #region Relation Bind //objContact = new EmpContactItem(); //objServiceEmp = new EmployeeService(); //List<MasterDataItem> objMasterDataListR = new List<MasterDataItem>(); //objMasterDataListR = objServiceEmp.GetMasterData(35); #endregion return(View(objAllItem)); }