private void PopulateDataGrid()
        {
            // Bind users to Grid.

            List <StaffingData> staffingData = staffingDataDA.GetAllStaffing();

            //Populate the ward name
            foreach (var item in staffingData)
            {
                item.WardName = staffingDataDA.GetWardNameByWardCode(item.WardCode);
            }

            // Select rows which has WardName, ignore the rest
            List <StaffingData> staffingDataToDisplay = staffingData.Where(data => data.WardName != string.Empty).ToList();

            if (null != staffingDataToDisplay)
            {
                StaffingData_Grid.DataSource = staffingDataToDisplay;
                StaffingData_Grid.DataBind();

                BindWardNames(staffingDataToDisplay);
                BindShifts(staffingDataToDisplay);
                BindDays();

                InsertDropdownDefaultValue();
            }
        }
        private void LoadDataForUpdate()
        {
            List <StaffingData> staffingData = new List <StaffingData>();

            staffingData = staffingDataDA.GetAllStaffing();

            //Staffing date range index
            int sdri;

            int.TryParse(DatePeriodRange_DropDownList.SelectedItem.Value, out sdri);

            foreach (var staffingDataItem in staffingData)
            {
                if (staffingDataItem.WardCode == WardName_DropDownList.SelectedItem.Value &&
                    staffingDataItem.Shift == Shift_DropDownList.SelectedItem.Text &&
                    staffingDataItem.StaffingDate == Day_DropDownList.SelectedItem.Text &&
                    staffingDataItem.StaffingDateRangeIndex == sdri)
                {
                    //populate the data for update
                    Beds_TextBox.Text = staffingDataItem.Beds.ToString(CultureInfo.InstalledUICulture);
                    RN_OptimumStaffing_TextBox.Text  = staffingDataItem.OptimumRN.ToString(CultureInfo.InstalledUICulture);
                    HCA_OptimumStaffing_TextBox.Text = staffingDataItem.OptimumHCA.ToString(CultureInfo.InstalledUICulture);
                    RN_SafeStaffing_TextBox.Text     = staffingDataItem.SafeRN.ToString(CultureInfo.InstalledUICulture);
                    HCA_SafeStaffing_TextBox.Text    = staffingDataItem.SafeHCA.ToString(CultureInfo.InstalledUICulture);

                    StaffingDataEntryFound_HiddenField.Text = "true";
                    break;
                }
                else
                {
                    StaffingDataEntryFound_HiddenField.Text = "false";
                    ClearFields();
                }
            }
        }
예제 #3
0
    private void LoadBasicData()
    {
        ShiftTypeDA sda = new ShiftTypeDA();

        AllShiftTypes = sda.GetAllShiftType();

        WardDA wda = new WardDA();

        AllWards = wda.GetAllWard();

        StaffingDataDA stda = new StaffingDataDA();

        AllStaffing = stda.GetAllStaffing();

        StaffingDateRangeDA stfda = new StaffingDateRangeDA();

        AllStaffingDateRanges = stfda.GetAllStaffingDateRanges();

        //string safeMitigations = WebConfigurationManager.AppSettings["SafeMitigationActions"];
        //this.SafeMitigations = new List<string>();
        //this.SafeMitigations.AddRange(safeMitigations.Split('|'));

        MitigationActionsDA mtada = new MitigationActionsDA();

        this.UnSafeMitigations = mtada.GetAllMitigationActions();
    }
예제 #4
0
    public void RefreshStaffingData()
    {
        StaffingDataDA stda = new StaffingDataDA();

        AllStaffing = stda.GetAllStaffing();
    }