//creates a list of staffmembers and stores in the session public List <Staff> StaffList() { DataSet dsStaff; StaffDataController dataController = new StaffDataController(); //retrieves staff data and stores it in a dataset dsStaff = dataController.GetAllStaff(); //stores each staff member and their properties to a list of Staff objects var staff = (from drRow in dsStaff.Tables[0].AsEnumerable() select new Staff() { firstName = drRow.Field <string>("firstName"), lastName = drRow.Field <string>("lastName"), fullName = drRow.Field <string>("firstName") + " " + drRow.Field <string>("lastName"), staffID = drRow.Field <int>("staffID"), status = drRow.Field <int>("staffStatus"), staffAltID = drRow.Field <string>("staffAltID") }).ToList(); //stores the list in the session System.Web.HttpContext.Current.Session["staffList"] = staff; return(staff); }
public SelectList GetStaffList() { StaffDataController staffController = new StaffDataController(); SelectList staffList = staffController.GetStaffDropDown(); return(new SelectList(staffList, "Value", "Text")); }
//Populates a dropdown for address types public SelectList GetAddressTypeList() { SelectList addressList; StaffDataController dataController = new StaffDataController(); addressList = dataController.GetAddressTypeList(); return(new SelectList(addressList, "Value", "Text", new Address().addressTypeID)); }
//populates drop down list for contact info type public SelectList GetContactTypeList() { SelectList contactList; StaffDataController dataController = new StaffDataController(); contactList = dataController.GetContactTypeList(); return(new SelectList(contactList, "Value", "Text", new AdditionalContactInfoModel().additionalContactInfoTypeID)); }
//populates drop down for member type public SelectList GetMemberTypeList() { SelectList memberList; StaffDataController dataController = new StaffDataController(); memberList = dataController.GetMemberTypeList(); return(new SelectList(memberList, "Value", "Text", new AdditionalContactInfoModel().memberTypeID)); }
//populates a status dropdown public SelectList GetStatusList() { SelectList statusList; StaffDataController dataController = new StaffDataController(); statusList = dataController.GetStatusList(); return(new SelectList(statusList, "Value", "Text", new Staff().status)); }
public ActionResult staffUpdate(Staff staff, Address address, AdditionalContactInfoModel aci) { bool success; StaffDataController dataController = new StaffDataController(); staff.deleted = true; success = dataController.InsertStaff(staff, address, aci); return(Content(success.ToString())); }
public ActionResult GetStaffMember(int staffID) { Staff staffMember = new Staff(); StaffDataController dataController = new StaffDataController(); staffMember = dataController.GetStaffMember(staffID); // staffMember = dataController.getStaffMember(Convert.ToInt32(staffMember.staffID)); System.Web.HttpContext.Current.Session["staffMember"] = staffMember; ViewBag.statusList = GetStatusList(); return(PartialView("Staff_Partial")); }
//used to fill webgrid with staff details public ActionResult Staff_Time_Headers(string staffID) { try { List <Staff> staffList; StaffDataController dataController = new StaffDataController(); //staffList() creates a list of all staff members and stores it to the session staffList = StaffList(); return(PartialView("TimeSheet_Grid_Partial", staffList)); } catch (Exception ex) { return(Json(new { ok = false, message = ex.Message })); } }