public ActionResult Create() { MainApplication model = new MainApplication() { EmployeeDetails = new EmployeeMaster(), }; EmployeeMaster emp = _EmployeeMasterService.getLastInsertedEmp(); int lastid = 0; int length = 0; if (emp != null) { lastid = emp.EmpId; lastid = lastid + 1; length = lastid.ToString().Length; } else { lastid = 1; length = 1; } string catCode = _utilityservice.getName("EMP", length, lastid); model.EmployeeDetails.EmployeeCode = catCode; TempData["employeecode"] = catCode; string mssgbox = string.Empty; model.BloodGroups = _BloodGroupService.GetBloodGroup(); model.totalExpYears = _YearExperienceService.GetYearExp(); model.totalExpmonths = _MonthExperienceService.GetMonthExp(); model.TypeOfSupplierList = _TypeOfSupplierService.GetTypeOfSuppliers(); model.StateList = _stateService.GetStateByCountry(1); model.EmployeeDetails.deptlist = _departmentservive.getAllDepartments(); model.EmployeeDetails.DesignationList = _DesignationMasterService.GetDesignations(); model.EmployeeDetails.BankNameList = _BankNameService.getAllBankNames(); model.EmployeeDetails.deptlist = _departmentservive.getAllDepartments(); model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail); model.modulelist = _iIModuleService.getAllModules(); model.CompanyCode = CompanyCode; model.CompanyName = CompanyName; model.FinancialYear = FinancialYear; return(View(model)); }
public IActionResult Index() { var postList = postService.GetPosts().OrderByDescending(s => s.AddDate).ToList(); List <PostVM> posts = new List <PostVM>(); foreach (var it in postList) { PostVM post = new PostVM(); post.Headline = it.Headline; post.Description = it.Description; post.AddDate = it.AddDate; post.Location = it.Location; post.BloodGroup = bloodGroupService.GetBloodGroup(it.BloodGroupID.Value).Name; } return(View(posts)); }
public ActionResult CreateJobWorker() { MainApplication model = new MainApplication() { JobWorkerDetails = new JobWorker(), }; JobWorker worker = _JobWorkerService.GetLastRow(); int Val = 0; int length = 0; if (worker != null) { Val = worker.Id; Val = Val + 1; length = Val.ToString().Length; } else { Val = 1; length = 1; } string code = _utilityService.getName("JW", length, Val); model.JobWorkerDetails.Code = code; TempData["PreviousJobWorker"] = code; string mssgbox = string.Empty; model.BankNameList = _BankNameService.getAllBankNames(); model.StateList = _StateService.GetStateByCountry(1); model.BloodGroups = _BloodGroupService.GetBloodGroup(); model.totalExpYears = _YearExperienceService.GetYearExp(); model.totalExpmonths = _MonthExperienceService.GetMonthExp(); model.DepartmentList = _DepartmentService.getAllDepartments(); model.DesignationList = _DesignationMasterService.getAllDesignation(); model.TypeOfSupplierList = _TypeOfSupplierService.GetTypeOfSuppliers(); model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail); model.modulelist = _ModuleService.getAllModules(); model.CompanyCode = CompanyCode; model.CompanyName = CompanyName; model.FinancialYear = FinancialYear; return(View(model)); }
public IActionResult Search(SearchVM search) { var donorList = userManager.Users.Where(s => s.CityID == search.City && s.BloodGroupID == search.BloodGroup).ToList(); List <DonorVM> donors = new List <DonorVM>(); foreach (var d in donorList) { DonorVM dn = new DonorVM(); dn.ID = d.Id; dn.FullName = d.Fullname; dn.Contact = d.ContactNumber; dn.Contact2 = d.PhoneNumber; donors.Add(dn); } var bloodGroupName = bloodGroupService.GetBloodGroup(search.BloodGroup.Value).Name; var CityName = cityService.GetCity(search.City.Value).Name; ViewBag.Message = "Showing " + bloodGroupName + " blood donors in " + CityName + " City"; return(View(donors)); }
public async Task <IActionResult> EditProfile() { ViewBag.BloodGroup = new SelectList(bloodGroupService.GetBloodGroups().ToList(), "Id", "Name"); ViewBag.City = new SelectList(cityService.GetCitys().ToList(), "Id", "Name"); ApplicationUser usr = await GetCurrentUserAsync(); DonorVM model = new DonorVM(); model.FullName = usr.Fullname; model.Address = usr.Address; model.Contact = usr.PhoneNumber; model.Contact2 = usr.ContactNumber; model.City = usr.CityID != null?cityService.GetCity(usr.CityID.Value).Name : "Not set"; model.BloodGroup = usr.BloodGroupID != null?bloodGroupService.GetBloodGroup(usr.BloodGroupID.Value).Name : "Not set"; model.BloodGroupID = usr.BloodGroupID != null ? usr.BloodGroupID.Value:0; model.CityID = usr.CityID != null ? usr.CityID.Value:0; return(View(model)); }