Пример #1
0
        //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);
        }
Пример #2
0
        public SelectList GetStaffList()
        {
            StaffDataController staffController = new StaffDataController();
            SelectList          staffList       = staffController.GetStaffDropDown();

            return(new SelectList(staffList, "Value", "Text"));
        }
Пример #3
0
        //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));
        }
Пример #4
0
        //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));
        }
Пример #5
0
        //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));
        }
Пример #6
0
        //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));
        }
Пример #7
0
        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()));
        }
Пример #8
0
        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"));
        }
Пример #9
0
        //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 }));
            }
        }