public async Task <IActionResult> StaffsList(int pg = 1) { try { ViewBag.ddlGenders = _GendersServ.Dropdown_Genders(); var StaffsList = Task.Run(() => _StaffsServ.getStaffsList(new Service.ServiceModels.StaffsServ.getStaffsList() { WebRootPath = _he.WebRootPath })); var result = await StaffsList; ViewBag.ddlDesignations = _DesignationsServ.dropdown_Designations(); var list = new List <IndexStaffsListVM_Staffs>(); foreach (var item in result._Staffs.ToList()) { var temp = new IndexStaffsListVM_Staffs() { Id = item.Id, GenderId = item.GenderId, GenderName = item.GenderName, IP300X200 = item.IP300X200, DesignationId = item.DesignationId, FirstName = item.FirstName, LastName = item.LastName, Name = item.Name, Designation = item.Designation, Cell = item.Cell, Email = item.Email, Education = item.Education, Address = item.Address }; list.Add(temp); } ; #region "Paging" const int pageSize = 5; if (pg < 1) { pg = 1; } int recsCount = list.Count(); var pager = new Pager(recsCount, pg, pageSize); int recSkip = (pg - 1) * pageSize; var data = list.Skip(recSkip).Take(pager.PageSize).ToList(); this.ViewBag.Pager = pager; var model = new IndexStaffsListVM() { _Staffs = data }; #endregion "Paging" return(View("StaffsList", model)); } catch (Exception) { return(BadRequest()); } }
public async Task <IActionResult> StaffList() { try { ViewBag.ddlGenders = _GendersServ.Dropdown_Genders(); var StaffsList = Task.Run(() => _SalariesServ.getStaffList(_he.WebRootPath)); var result = await StaffsList; ViewBag.ddlDesignations = _DesignationsServ.dropdown_Designations(); var list = new List <IndexStaffListVM_Staffs>(); foreach (var item in result._Staffs.ToList()) { var temp = new IndexStaffListVM_Staffs() { Id = item.Id, GenderId = item.GenderId, SalaryYear = item.SalaryYear, IP300X200 = item.IP300X200, DesignationId = item.DesignationId, FirstName = item.FirstName, LastName = item.LastName, Name = item.Name, Designation = item.Designation, YearlyTermNo = item.YearlyTermNo, NetSalary = item.NetSalary, Cell = item.Cell, Email = item.Email, Address = item.Address }; list.Add(temp); } ; var model = new IndexStaffListVM() { _Staffs = list }; return(View("StaffList", model)); } catch (Exception) { return(BadRequest()); } }
public async Task <IActionResult> LicensedUserList(int pg = 1) { try { var LicensedUserList = Task.Run(() => _userAuthentication.GetLicenses()); var result = await LicensedUserList; ViewBag.ddlActors = _actorServ.Dropdown_Actors(); ViewBag.ddlGender = _GenderServ.Dropdown_Genders(); var list = new List <IndexUserAuthenticationsVM_UserAuthentications>(); foreach (var item in result._UserAuthentications.ToList()) { var temp = new IndexUserAuthenticationsVM_UserAuthentications() { Id = item.Id, ActorId = item.ActorId, UserId = item.UserId, IsActive = item.IsActive, UserName = item.UserName, ActorName = item.Actor, OurEduId = item.OurEduId, FirstName = item.FirstName, LastName = item.LastName, Password = item.Password, Email = item.Email, Contact = item.Contact, GenderId = item.GenderId }; list.Add(temp); } ; #region "Paging" const int pageSize = 5; if (pg < 1) { pg = 1; } int recsCount = list.Count(); var pager = new Pager(recsCount, pg, pageSize); int recSkip = (pg - 1) * pageSize; var data = list.Skip(recSkip).Take(pager.PageSize).ToList(); this.ViewBag.Pager = pager; var model = new IndexUserAuthenticationsVM() { OELicensedUsersListVMs = data }; #endregion "Paging" return(View("LicensedUserList", model)); } catch (Exception) { return(BadRequest()); } }
public async Task <IActionResult> SearchStudentList(string RegistrationId) { try { if (String.IsNullOrEmpty(RegistrationId)) { var model = new IndexSearchStudentListVM() { //Students = null, RegistrationId = null }; return(View("SearchStudentList", model)); } else { var result = new SearchStudentList() { RegistrationId = RegistrationId }; var studentList = await Task.Run(() => _StudentPaymentsServ.SearchStudentList(result)); ViewBag.ddlClasses = _classesServ.dropdown_Class(); ViewBag.ddlGenders = _GendersServ.Dropdown_Genders(); if (studentList.Students != null) { var temp = new IndexSearchStudentListVM_Students() { Id = studentList.Students.Id, ClassId = studentList.Students.ClassId, RegistrationNo = studentList.Students.RegistrationNo, ClassName = studentList.Students.ClassName, GenderId = studentList.Students.GenderId, GenderName = studentList.Students.GenderName, FirstName = studentList.Students.FirstName, LastName = studentList.Students.LastName, StudentName = studentList.Students.StudentName, IP300X200 = studentList.Students.IP300X200, AdmittedYear = studentList.Students.AdmittedYear, PresentAddress = studentList.Students.PresentAddress, PermanentAddress = studentList.Students.PermanentAddress, DOB = studentList.Students.DOB, IsActive = studentList.Students.IsActive, AddedBy = studentList.Students.AddedBy = 0, AddedDate = DateTime.Now, ModifiedBy = 0, ModifiedDate = DateTime.Now, DataType = null }; var model = new IndexSearchStudentListVM() { Students = temp, RegistrationId = RegistrationId, }; return(View("SearchStudentList", model)); } else { var model = new IndexSearchStudentListVM() { Students = null, RegistrationId = RegistrationId, }; return(View("SearchStudentList", model)); } } } catch (Exception) { return(BadRequest()); } }
public async Task <IActionResult> StudentsByAccountant(string SearchStudentClassId, int pg = 1) { try { if (String.IsNullOrEmpty(SearchStudentClassId)) { ViewBag.ddlClasses = _classesServ.dropdown_Class(); ViewBag.searchRequest = false; var model = new StudentsByAccountantVM() { _Students = null, SearchStudentClassId = null }; return(View("StudentsByAccountant", model)); } else { var result = new SearchStudentsByClass() { WebRootPath = _he.WebRootPath, SearchStudentClassId = SearchStudentClassId }; var SearchStudentsByClass = await Task.Run(() => _studentsServ.SearchStudentsByClass(result)); ViewBag.ddlClasses = _classesServ.dropdown_Class(); ViewBag.ddlGenders = _GendersServ.Dropdown_Genders(); var list = new List <StudentsByAccountantVM_Students>(); foreach (var item in SearchStudentsByClass._Students.ToList()) { var temp = new StudentsByAccountantVM_Students() { Id = item.Id, ClassId = item.ClassId, ClassName = item.ClassName, GenderId = item.GenderId, GenderName = item.GenderName, RegistrationNo = item.RegistrationNo, FirstName = item.FirstName, LastName = item.LastName, StudentName = item.StudentName, FatherName = item.FatherName, MotherName = item.MotherName, ParentsName = item.ParentsName, CurrentClassName = item.CurrentClassName, CurrentYear = item.CurrentYear, IP300X200 = item.IP300X200, AdmittedYear = item.AdmittedYear, PresentAddress = item.PresentAddress, PermanentAddress = item.PermanentAddress, DOB = item.DOB, IsActive = item.IsActive, AddedBy = item.AddedBy = 0, AddedDate = DateTime.Now, ModifiedBy = 0, ModifiedDate = DateTime.Now, DataType = null }; list.Add(temp); } ; #region "Paging" const int pageSize = 5; if (pg < 1) { pg = 1; } int recsCount = list.Count(); var pager = new Pager(recsCount, pg, pageSize); int recSkip = (pg - 1) * pageSize; var data = list.Skip(recSkip).Take(pager.PageSize).ToList(); this.ViewBag.Pager = pager; var model = new StudentsByAccountantVM() { ClassName = SearchStudentsByClass.SearchStudentClassName, _Students = data, SearchStudentClassId = SearchStudentClassId }; #endregion "Paging" return(View("StudentsByAccountant", model)); } } catch { return(BadRequest()); } }