示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            int intRecordAffected = 0;

            clsSchedule schedule = new clsSchedule();

            schedule.SundayShift    = cmbShiftSun.SelectedValue.ToString();
            schedule.MondayShift    = cmbShiftMon.SelectedValue.ToString();
            schedule.TuesdayShift   = cmbShiftTue.SelectedValue.ToString();
            schedule.WednesdayShift = cmbShiftWed.SelectedValue.ToString();
            schedule.ThursdayShift  = cmbShiftThu.SelectedValue.ToString();
            schedule.FridayShift    = cmbShiftFri.SelectedValue.ToString();
            schedule.SaturdayShift  = cmbShiftSat.SelectedValue.ToString();
            schedule.Remarks        = txtRemarks.Text;
            schedule.LastUpdateDate = DateTime.Now;
            schedule.LastUpdateBy   = HRMSCore.Username;
            intRecordAffected       = schedule.Add();

            if (intRecordAffected < 1)
            {
                MessageBox.Show(clsMessageBox.MessageBoxErrorAdd, clsMessageBox.MessageBoxText, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                switch (_FormCaller)
                {
                case FormCallers.ScheduleList:
                    pfrmScheduleList.BindScheduleList();
                    break;
                }
                this.Close();
            }
        }
示例#2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Warning: \nModifying schedule settings might cause discrepancies on employee's schedule associated with it. \nIt is advisable to create a new schedule than to modify it.\n\nAre you sure to continue?", clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                int         intRecordsAffected = 0;
                clsSchedule schedule           = new clsSchedule();
                schedule.ScheduleCode   = txtScheduleCode.Text;
                schedule.SundayShift    = cmbShiftSun.SelectedValue.ToString();
                schedule.MondayShift    = cmbShiftMon.SelectedValue.ToString();
                schedule.TuesdayShift   = cmbShiftTue.SelectedValue.ToString();
                schedule.WednesdayShift = cmbShiftWed.SelectedValue.ToString();
                schedule.ThursdayShift  = cmbShiftThu.SelectedValue.ToString();
                schedule.FridayShift    = cmbShiftFri.SelectedValue.ToString();
                schedule.SaturdayShift  = cmbShiftSat.SelectedValue.ToString();
                schedule.Remarks        = txtRemarks.Text;
                schedule.LastUpdateBy   = HRMSCore.Username;
                schedule.LastUpdateDate = DateTime.Now;
                intRecordsAffected      = schedule.Edit();

                if (intRecordsAffected < 1)
                {
                    MessageBox.Show("Error: An error occured while updating your record.\n\nPlease contact your system administrator", clsMessageBox.MessageBoxText, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    _frmScheduleList.BindScheduleList();
                    this.Close();
                }
            }
        }
示例#3
0
        private void AddProject()
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            clsSchedule Schedule = new clsSchedule();
            Project Project = new Project();

            System.Globalization.CultureInfo dateFormat = new System.Globalization.CultureInfo("en-US", true);
            DateTime estStartDate = new DateTime();
            DateTime estCompletionDate = new DateTime();
            decimal feeAmount = default(decimal);
            int pic = 0;
            string picCode = string.Empty;
            int pm = 0;
            string pmCode = string.Empty;

            if (!string.IsNullOrEmpty(txtEstStartOfConstruction.Text))
            {
                estStartDate = DateTime.Parse(txtEstStartOfConstruction.Text,  dateFormat);
                //strSQL += "'" & CleanString(basToolbox.Nz(txtEstStartOfConstruction.Text, "")) & "', "
                //Else
                //strSQL += "NULL, "
            }
            if (!string.IsNullOrEmpty(txtEstCompletionOfConstruction.Text))
            {
                estCompletionDate = DateTime.Parse(txtEstCompletionOfConstruction.Text, dateFormat);
                //strSQL += "'" & CleanString(basToolbox.Nz(txtEstCompletionOfConstruction.Text, "")) & "', "
                //Else
                //strSQL += "NULL, "
            }
            if (!string.IsNullOrEmpty(txtFeeAmount.Text))
            {
                decimal.TryParse(txtFeeAmount.Text.Replace("$", "").Replace(",", ""), out feeAmount);
            }

            pic = Convert.ToInt32(cboPIC.SelectedValue);
            if (!(pic == 0))
            {
                picCode = Schedule.GetEmployeeCode(pic);
            }
            pm = Convert.ToInt32(cboPM.SelectedValue);
            if (!(pm == 0))
            {
                pmCode = Schedule.GetEmployeeCode(pm);
                //strSQL += Zz(cboPM.SelectedValue, 0) & ", "
                //strSQL += "'" & Schedule.GetEmployeeCode(Zz(cboPM.SelectedValue, 0)) & "')"
                //Else
                //strSQL += "NULL, NULL)"
            }

            Project.CreateNewProject(Convert.ToDecimal(txtProjectNo.Text), txtProjectName.Text, Convert.ToInt32(cboClientName.SelectedValue), txtProjectLocation.Text, txtConstructionType.Text, txtProjectType.Text, Convert.ToInt32(cboPhase.SelectedValue), estStartDate, estCompletionDate, feeAmount,
            cboFeeStructure.SelectedValue, txtRemarks.Text, pic, picCode, pm, pmCode, EmployeeID);

            //General.FillDataset(strSQL)
        }
示例#4
0
 private void tbtnDelete_Click(object sender, EventArgs e)
 {
     if (dgScheduleList.SelectedRows.Count > 0)
     {
         if (MessageBox.Show("Warning: \nDeleting schedule settings might cause discrepancies on employee's schedule associated with it. \nIt is advisable to disable the shift than to delete it.\n\nAre you sure to continue?", clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
         {
             clsSchedule schedule = new clsSchedule();
             schedule.ScheduleCode = dgScheduleList.SelectedRows[0].Cells[0].Value.ToString();
             schedule.Delete();
             BindScheduleList();
         }
     }
 }
示例#5
0
        private void BindDetails()
        {
            clsSchedule schedule = new clsSchedule(_strScheduleCode);

            schedule.Fill();
            cmbShiftSun.SelectedValue = schedule.SundayShift;
            cmbShiftMon.SelectedValue = schedule.MondayShift;
            cmbShiftTue.SelectedValue = schedule.TuesdayShift;
            cmbShiftWed.SelectedValue = schedule.WednesdayShift;
            cmbShiftThu.SelectedValue = schedule.ThursdayShift;
            cmbShiftFri.SelectedValue = schedule.FridayShift;
            cmbShiftSat.SelectedValue = schedule.SaturdayShift;
            txtRemarks.Text           = schedule.Remarks;
        }
示例#6
0
        private void RefreshTotalWorkingHours()
        {
            //float fltRequiredWorkingHours = float.Parse(clsSystemSettings.GetValue(HRMSCore.RequiredTotalWorkHoursKey));
            float       fltTotalWorkingHours = 0;
            clsSchedule schedule             = new clsSchedule();

            schedule.MondayShift    = cmbShiftMon.SelectedValue.ToString();
            schedule.TuesdayShift   = cmbShiftTue.SelectedValue.ToString();
            schedule.WednesdayShift = cmbShiftWed.SelectedValue.ToString();
            schedule.ThursdayShift  = cmbShiftThu.SelectedValue.ToString();
            schedule.FridayShift    = cmbShiftFri.SelectedValue.ToString();
            schedule.SaturdayShift  = cmbShiftSat.SelectedValue.ToString();
            schedule.SundayShift    = cmbShiftSun.SelectedValue.ToString();
            fltTotalWorkingHours    = schedule.GetTotalWorkingHours();
            txtTotalHours.Text      = fltTotalWorkingHours.ToString();
            //txtTotalHours.BackColor = (fltTotalWorkingHours < fltRequiredWorkingHours ? Color.MistyRose : Color.AliceBlue);
        }
示例#7
0
        private void InitializeGrid()
        {
            clsSchedule cSchedule = new clsSchedule();
            int intHeight = 0;
            int intI = 0;
            UltraGridLayout uwgLayout = this.uwgProjects.DisplayLayout;
            //
            uwgLayout.RowHeightDefault = Unit.Pixel(13);

            ///''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            // First Band
            uwgLayout.Bands[0].AllowUpdate = AllowUpdate.No;
            this.uwgProjects.Bands[0].DefaultColWidth = Unit.Pixel(100);
            // Show footer
            this.uwgProjects.DisplayLayout.Bands[0].ColFootersVisible = ShowMarginInfo.Yes;
            this.uwgProjects.Bands[0].FooterStyle.CssClass = "FooterStyle";
            // 0
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectID").Hidden = true;
            // 1
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectNo").Header.Caption = "JOB #";
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectNo").Width = Unit.Pixel(85);
            // 2
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectName").Header.Caption = "PROJECT";
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectName").Width = Unit.Pixel(260);
            // 3
            this.uwgProjects.Bands[0].Columns.FromKey("PICCode").Header.Caption = "PIC";
            this.uwgProjects.Bands[0].Columns.FromKey("PICCode").Width = Unit.Pixel(70);
            // 4
            this.uwgProjects.Bands[0].Columns.FromKey("PM1Code").Header.Caption = "PM";
            this.uwgProjects.Bands[0].Columns.FromKey("PM1Code").Width = Unit.Pixel(70);
            for (intI = 5; intI <= 24; intI++)
            {
                this.uwgProjects.Bands[0].Columns[intI].CellStyle.HorizontalAlign = HorizontalAlign.Center;
                this.uwgProjects.Bands[0].Columns[intI].Width = Unit.Pixel(35);
                this.uwgProjects.Bands[0].Columns[intI].Header.Style.CssClass = "WeekHeaderStyle";
                this.uwgProjects.Bands[0].Columns[intI].Header.Caption = WeekDate.WeekLabels[intI - 5];
                this.uwgProjects.Bands[0].Columns[intI].DataType = "System.Decimal";
                this.uwgProjects.Bands[0].Columns[intI].Footer.Total = SummaryInfo.Sum;
            }
        }
示例#8
0
        public void LoadSchedule()
        {
            string    strCurrentScheduleCode = "";
            DataTable tblEmployee            = Employee.DSGEmployeeScheduleList(EmployeeAccountType.Active);

            lvScheduleManagement.Items.Clear();
            foreach (DataRow drw in tblEmployee.Rows)
            {
                strCurrentScheduleCode = Employee.GetScheduleCurrent(drw["username"].ToString(), DateTime.Now);
                ListViewItem lvi = new ListViewItem();
                lvi.Text = drw["empnum"].ToString();
                lvi.Tag  = drw["username"].ToString();
                lvi.SubItems.Add(drw["pname"].ToString());
                lvi.SubItems.Add(strCurrentScheduleCode);
                using (clsSchedule schedule = new clsSchedule())
                {
                    schedule.ScheduleCode = strCurrentScheduleCode;
                    schedule.Fill();
                    lvi.SubItems.Add(schedule.MondayShift);
                    lvi.SubItems.Add(schedule.TuesdayShift);
                    lvi.SubItems.Add(schedule.WednesdayShift);
                    lvi.SubItems.Add(schedule.ThursdayShift);
                    lvi.SubItems.Add(schedule.FridayShift);
                    lvi.SubItems.Add(schedule.SaturdayShift);
                    lvi.SubItems.Add(schedule.SundayShift);
                }
                lvi.SubItems.Add(drw["schdcode"].ToString());

                lvi.BackColor = (drw["schdcode"].ToString() == strCurrentScheduleCode ? Color.White : Color.Honeydew);
                lvScheduleManagement.Items.Add(lvi);
            }
            if (lvScheduleManagement.Items.Count > 0)
            {
                lvScheduleManagement.Items[0].Selected = true;
            }
        }
示例#9
0
        private void UpdateProject(int intProjectID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            clsSchedule Schedule = new clsSchedule();
            if (intProjectID == 0)
                return;

            Project Project = new Project();

            System.Globalization.CultureInfo dateFormat = new System.Globalization.CultureInfo("en-US", true);
            DateTime estStartDate = new DateTime();
            DateTime estCompletionDate = new DateTime();
            decimal feeAmount = default(decimal);
            int pic = 0;
            string picCode = string.Empty;
            int pm = 0;
            string pmCode = string.Empty;

            if (!string.IsNullOrEmpty(txtEstStartOfConstruction.Text))
            {
                estStartDate = DateTime.Parse(txtEstStartOfConstruction.Text);
            }
            if (!string.IsNullOrEmpty(txtEstCompletionOfConstruction.Text))
            {
                estCompletionDate = DateTime.Parse(txtEstCompletionOfConstruction.Text);
            }
            if (!string.IsNullOrEmpty(txtFeeAmount.Text))
            {
                decimal.TryParse(txtFeeAmount.Text.Replace("$", "").Replace(",", ""), out feeAmount);
            }

            int.TryParse(cboPIC.SelectedValue, out pic);
            if (pic != 0)
            {
                picCode = Schedule.GetEmployeeCode(pic);
            }
            int.TryParse(cboPM.SelectedValue, out pm);
            if (pm != 0)
            {
                pmCode = Schedule.GetEmployeeCode(pm);
            }

            Project.UpdateProject(intProjectID, Convert.ToDecimal(txtProjectNo.Text), txtProjectName.Text, Convert.ToInt32(cboClientName.SelectedValue), txtProjectLocation.Text, txtConstructionType.Text, txtProjectType.Text, Convert.ToInt32(cboPhase.SelectedValue), estStartDate, estCompletionDate,
            feeAmount, cboFeeStructure.SelectedValue, txtRemarks.Text, pic, picCode, pm, pmCode, EmployeeID);
        }
示例#10
0
 private void FormatGrid()
 {
     int intCols = 0;
     string strStyle = null;
     decimal val = 0;
     // Databind Grid
     this.uwgProjects.DataBind();
     //
     clsSchedule schedule = new clsSchedule();
     int intEmployeeID = 0;
     //
     InitializeGrid();
     //
     foreach (UltraGridRow uwgRow in this.uwgProjects.Rows)
     {
         if (uwgRow.Band.Index == 0)
         {
             uwgRow.Band.RowStyle.CssClass = "ChildRowStyle";
             uwgRow.Band.RowAlternateStyle.CssClass = "ChildAlternateRowStyle";
             intEmployeeID = uwgRow.Cells[15].Value.GetValueOrDefault<int>();
             for (intCols = 5; intCols <= 24; intCols++)
             {
                 val = schedule.GetEmployeeWeekTotal(intEmployeeID, WeekDate.WeekIDs[intCols - 5]);
                 strStyle = schedule.GetWeekHoursStyle((int)val);
                 uwgRow.Cells[intCols].Style.CssClass = strStyle;
             }
         }
     }
 }
示例#11
0
        public void TestMethod1()
        {
            clsSchedule ABooking = new clsSchedule();

            Assert.IsNotNull(ABooking);
        }
示例#12
0
        private void UpdateProject(int intProjectID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            clsSchedule Schedule = new clsSchedule();
            if (intProjectID == 0)
                return;

            strSQL = "UPDATE tblProjects ";
            strSQL += "SET ProjectName = '" + txtProjectName.Text + "', ";
            strSQL += "ProjectNo = '" + txtProjectNo.Text + "', ";
            strSQL += "ClientID = " + Convert.ToInt32(cboClientName.SelectedValue) + ", ";
            strSQL += "ProjectLocation = '" + txtProjectLocation.Text + "', ";
            strSQL += "ConstructionType = '" + txtConstructionType.Text + "', ";
            strSQL += "ProjectType = '" + txtProjectType.Text + "', ";
            strSQL += "PhaseID = " + Convert.ToInt32(cboPhase.SelectedValue) + ", ";
            if (!string.IsNullOrEmpty(txtEstStartOfConstruction.Text))
            {
                strSQL += "EstimatedStartDate = '" + txtEstStartOfConstruction.Text + "', ";
            }
            else
            {
                strSQL += "EstimatedStartDate = NULL, ";
            }
            if (!string.IsNullOrEmpty(txtEstCompletionOfConstruction.Text))
            {
                strSQL += "EstimatedCompletionDate = '" + txtEstCompletionOfConstruction.Text + "', ";
            }
            else
            {
                strSQL += "EstimatedCompletionDate = NULL, ";
            }
            if (!string.IsNullOrEmpty(txtFeeAmount.Text))
            {
                decimal feeAmount = 0;
                decimal.TryParse(txtFeeAmount.Text.Replace("$", "").Replace(",", ""), out feeAmount);
                strSQL += "FeeAmount = " + feeAmount.ToString() + ", ";
            }
            else
            {
                strSQL += "FeeAmount = NULL, ";
            }
            strSQL += "FeeStructure = '" + cboFeeStructure.SelectedValue + "', ";

            if (Convert.ToInt32(cboPIC.SelectedValue) != 0)
            {
                strSQL += "PIC = " + cboPIC.SelectedValue + ", ";
                strSQL += "PICCode = '" + Schedule.GetEmployeeCode(Convert.ToInt32(cboPIC.SelectedValue)) + "', ";
            }
            else
            {
                strSQL += "PIC = NULL, ";
                strSQL += "PICCode = NULL, ";
            }

            if (Convert.ToInt32(cboPM.SelectedValue) != 0)
            {
                strSQL += "PM1 = " + cboPM.SelectedValue + ", ";
                strSQL += "PM1Code = '" + Schedule.GetEmployeeCode(Convert.ToInt32(cboPM.SelectedValue)) + "', ";
            }
            else
            {
                strSQL += "PM1 = NULL, ";
                strSQL += "PM1Code = NULL, ";
            }

            strSQL += "Comments = '" + txtRemarks.Text + "' ";
            strSQL += "WHERE ID = " + intProjectID;

            General.FillDataset(strSQL);
        }
示例#13
0
 private void FormatGrid()
 {
     int intCols = 0;
     string strStyle = null;
     object val = null;
     //
     clsSchedule schedule = new clsSchedule();
     int intEmployeeID = Request.Params["EID"].GetValueOrDefault<int>();
     // Databind Grid
     this.uwgProjects.DataBind();
     //
     InitializeGrid();
     //
     //UltraGridRow uwgRow = default(UltraGridRow);
     //
     foreach (UltraGridRow uwgRow in this.uwgProjects.Rows)
     {
     if (uwgRow.Band.Index == 0) {
         uwgRow.Band.RowStyle.CssClass = "ChildRowStyle";
         uwgRow.Band.RowAlternateStyle.CssClass = "ChildAlternateRowStyle";
         for (intCols = 4; intCols <= 13; intCols++) {
             val = schedule.GetEmployeeWeekTotal(intEmployeeID, intWeekIDs[intCols - 4]);
             strStyle = schedule.GetWeekHoursStyle(val.GetValueOrDefault<int>());
             uwgRow.Cells[intCols].Style.CssClass = strStyle;
         }
     }
     }
 }
示例#14
0
        private void InitializeGrid()
        {
            clsSchedule cSchedule = new clsSchedule();
            int intHeight = 0;
            int intI = 0;
            UltraGridLayout uwgLayout = this.uwgProjects.DisplayLayout;
            string weekLabel = null;
            int gridWidth = 595;
            //
            uwgLayout.RowHeightDefault = Unit.Pixel(13);

            // sets the height of the control
            if (Convert.ToInt32(Session["ScreenH"]) != 0)
            {
                intHeight = cSchedule.GetGridHeight(Session["ScreenH"].GetValueOrDefault<string>());
                this.uwgProjects.Height = Unit.Pixel(intHeight);
            }

            ///''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            //changes the sort icons
            uwgLayout.ImageUrls.SortDescending = "./images/spacer.gif";
            uwgLayout.ImageUrls.SortAscending = "./images/spacer.gif";
            // First Band
            uwgLayout.Bands[0].AllowUpdate = AllowUpdate.No;
            this.uwgProjects.Bands[0].DefaultColWidth = Unit.Pixel(100);
            //
            // 0
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectID").Hidden = true;

            //1
            UltraGridColumn restoreColumn = this.uwgProjects.Bands[0].Columns.FromKey("Restore");

            if ((restoreColumn == null))
            {
                restoreColumn = new UltraGridColumn();
                this.uwgProjects.Bands[0].Columns.Insert(1, restoreColumn);
            }

            restoreColumn.Header.Caption = "Restore";
            restoreColumn.Key = "Restore";
            restoreColumn.Type = ColumnType.CheckBox;
            restoreColumn.CellStyle.HorizontalAlign = HorizontalAlign.Center;
            restoreColumn.Width = 70;
            restoreColumn.AllowUpdate = AllowUpdate.Yes;

            // 2
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectNo").Header.Caption = "JOB #";
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectNo").Width = Unit.Pixel(85);
            // 3
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectName").Header.Caption = "PROJECT";
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectName").Width = Unit.Pixel(260);
            // 4
            this.uwgProjects.Bands[0].Columns.FromKey("PICCode").Header.Caption = "PIC";
            this.uwgProjects.Bands[0].Columns.FromKey("PICCode").Width = Unit.Pixel(70);
            // 5
            this.uwgProjects.Bands[0].Columns.FromKey("PM1Code").Header.Caption = "PM";
            this.uwgProjects.Bands[0].Columns.FromKey("PM1Code").Width = Unit.Pixel(70);
            for (intI = 6; intI <= 15; intI++)
            {
                this.uwgProjects.Bands[0].Columns[intI].CellStyle.HorizontalAlign = HorizontalAlign.Center;

                weekLabel = strWeekLabel[intI - 6];

                if ((weekLabel.Length > 4))
                {
                    this.uwgProjects.Bands[0].Columns[intI].Width = Unit.Pixel(45);
                    gridWidth += 45;
                }
                else
                {
                    this.uwgProjects.Bands[0].Columns[intI].Width = Unit.Pixel(35);
                    gridWidth += 35;
                }

                this.uwgProjects.Bands[0].Columns[intI].Header.Style.CssClass = "WeekHeaderStyle";
                this.uwgProjects.Bands[0].Columns[intI].Header.Caption = weekLabel;
                this.uwgProjects.Bands[0].Columns[intI].DataType = "System.Decimal";
            }

            this.uwgProjects.Width = Unit.Pixel(gridWidth);
        }
示例#15
0
        private void LoadScheduleDetails(string pScheduleCode)
        {
            using (clsSchedule schedule = new clsSchedule(pScheduleCode))
            {
                schedule.Fill();
                txtMonShift.Text = schedule.MondayShift;
                txtTueShift.Text = schedule.TuesdayShift;
                txtWedShift.Text = schedule.WednesdayShift;
                txtThuShift.Text = schedule.ThursdayShift;
                txtFriShift.Text = schedule.FridayShift;
                txtSatShift.Text = schedule.SaturdayShift;
                txtSunShift.Text = schedule.SundayShift;
            }
            Color    clr = new Color();
            clsShift shift;

            #region " Monday "
            shift           = new clsShift();
            shift.ShiftCode = txtMonShift.Text;
            shift.Fill();
            txtMonBS.Text = shift.BreakTimeStart.ToString("hh:mm tt");
            txtMonBE.Text = shift.BreakTimeEnd.ToString("hh:mm tt");
            if (shift.ShiftModeCode == "W")
            {
                txtMonIn.Text   = shift.TimeStart.ToString("hh:mm tt");
                txtMonHalf.Text = shift.TimeHalf.ToString("hh:mm tt");
                txtMonOut.Text  = shift.TimeEnd.ToString("hh:mm tt");
                txtMonLate.Text = shift.LateTime.ToString("hh:mm tt");
                txtMonUT.Text   = shift.UnderTime.ToString("hh:mm tt");
            }
            clr = (shift.ShiftModeCode == "W" ? Color.Honeydew : Color.MistyRose);
            txtMonShift.BackColor = clr;
            txtMonIn.BackColor    = clr;
            txtMonHalf.BackColor  = clr;
            txtMonOut.BackColor   = clr;
            txtMonBS.BackColor    = clr;
            txtMonBE.BackColor    = clr;
            txtMonLate.BackColor  = clr;
            txtMonUT.BackColor    = clr;
            #endregion
            #region " Tuesday "
            shift           = new clsShift();
            shift.ShiftCode = txtTueShift.Text;
            shift.Fill();
            txtTueBS.Text = shift.BreakTimeStart.ToString("hh:mm tt");
            txtTueBE.Text = shift.BreakTimeEnd.ToString("hh:mm tt");
            if (shift.ShiftModeCode == "W")
            {
                txtTueIn.Text   = shift.TimeStart.ToString("hh:mm tt");
                txtTueHalf.Text = shift.TimeHalf.ToString("hh:mm tt");
                txtTueOut.Text  = shift.TimeEnd.ToString("hh:mm tt");
                txtTueLate.Text = shift.LateTime.ToString("hh:mm tt");
                txtTueUT.Text   = shift.UnderTime.ToString("hh:mm tt");
            }
            clr = (shift.ShiftModeCode == "W" ? Color.Honeydew : Color.MistyRose);
            txtTueShift.BackColor = clr;
            txtTueIn.BackColor    = clr;
            txtTueHalf.BackColor  = clr;
            txtTueOut.BackColor   = clr;
            txtTueBS.BackColor    = clr;
            txtTueBE.BackColor    = clr;
            txtTueLate.BackColor  = clr;
            txtTueUT.BackColor    = clr;
            #endregion
            #region " Wednesday "
            shift           = new clsShift();
            shift.ShiftCode = txtWedShift.Text;
            shift.Fill();
            txtWedBS.Text = shift.BreakTimeStart.ToString("hh:mm tt");
            txtWedBE.Text = shift.BreakTimeEnd.ToString("hh:mm tt");
            if (shift.ShiftModeCode == "W")
            {
                txtWedIn.Text   = shift.TimeStart.ToString("hh:mm tt");
                txtWedHalf.Text = shift.TimeHalf.ToString("hh:mm tt");
                txtWedOut.Text  = shift.TimeEnd.ToString("hh:mm tt");
                txtWedLate.Text = shift.LateTime.ToString("hh:mm tt");
                txtWedUT.Text   = shift.UnderTime.ToString("hh:mm tt");
            }
            clr = (shift.ShiftModeCode == "W" ? Color.Honeydew : Color.MistyRose);
            txtWedShift.BackColor = clr;
            txtWedIn.BackColor    = clr;
            txtWedHalf.BackColor  = clr;
            txtWedOut.BackColor   = clr;
            txtWedBS.BackColor    = clr;
            txtWedBE.BackColor    = clr;
            txtWedLate.BackColor  = clr;
            txtWedUT.BackColor    = clr;
            #endregion
            #region " Thursday "
            shift           = new clsShift();
            shift.ShiftCode = txtThuShift.Text;
            shift.Fill();
            txtThuBS.Text = shift.BreakTimeStart.ToString("hh:mm tt");
            txtThuBE.Text = shift.BreakTimeEnd.ToString("hh:mm tt");
            if (shift.ShiftModeCode == "W")
            {
                txtThuIn.Text   = shift.TimeStart.ToString("hh:mm tt");
                txtThuHalf.Text = shift.TimeHalf.ToString("hh:mm tt");
                txtThuOut.Text  = shift.TimeEnd.ToString("hh:mm tt");
                txtThuLate.Text = shift.LateTime.ToString("hh:mm tt");
                txtThuUT.Text   = shift.UnderTime.ToString("hh:mm tt");
            }
            clr = (shift.ShiftModeCode == "W" ? Color.Honeydew : Color.MistyRose);
            txtThuShift.BackColor = clr;
            txtThuIn.BackColor    = clr;
            txtThuHalf.BackColor  = clr;
            txtThuOut.BackColor   = clr;
            txtThuBS.BackColor    = clr;
            txtThuBE.BackColor    = clr;
            txtThuLate.BackColor  = clr;
            txtThuUT.BackColor    = clr;
            #endregion
            #region " Friday "
            shift           = new clsShift();
            shift.ShiftCode = txtFriShift.Text;
            shift.Fill();
            txtFriBS.Text = shift.BreakTimeStart.ToString("hh:mm tt");
            txtFriBE.Text = shift.BreakTimeEnd.ToString("hh:mm tt");
            if (shift.ShiftModeCode == "W")
            {
                txtFriIn.Text   = shift.TimeStart.ToString("hh:mm tt");
                txtFriHalf.Text = shift.TimeHalf.ToString("hh:mm tt");
                txtFriOut.Text  = shift.TimeEnd.ToString("hh:mm tt");
                txtFriLate.Text = shift.LateTime.ToString("hh:mm tt");
                txtFriUT.Text   = shift.UnderTime.ToString("hh:mm tt");
            }
            clr = (shift.ShiftModeCode == "W" ? Color.Honeydew : Color.MistyRose);
            txtFriShift.BackColor = clr;
            txtFriIn.BackColor    = clr;
            txtFriHalf.BackColor  = clr;
            txtFriOut.BackColor   = clr;
            txtFriBS.BackColor    = clr;
            txtFriBE.BackColor    = clr;
            txtFriLate.BackColor  = clr;
            txtFriUT.BackColor    = clr;
            #endregion
            #region " Saturday "
            shift           = new clsShift();
            shift.ShiftCode = txtSatShift.Text;
            shift.Fill();
            txtSatBS.Text = shift.BreakTimeStart.ToString("hh:mm tt");
            txtSatBE.Text = shift.BreakTimeEnd.ToString("hh:mm tt");
            if (shift.ShiftModeCode == "W")
            {
                txtSatIn.Text   = shift.TimeStart.ToString("hh:mm tt");
                txtSatHalf.Text = shift.TimeHalf.ToString("hh:mm tt");
                txtSatOut.Text  = shift.TimeEnd.ToString("hh:mm tt");
                txtSatLate.Text = shift.LateTime.ToString("hh:mm tt");
                txtSatUT.Text   = shift.UnderTime.ToString("hh:mm tt");
            }
            clr = (shift.ShiftModeCode == "W" ? Color.Honeydew : Color.MistyRose);
            txtSatShift.BackColor = clr;
            txtSatIn.BackColor    = clr;
            txtSatHalf.BackColor  = clr;
            txtSatOut.BackColor   = clr;
            txtSatBS.BackColor    = clr;
            txtSatBE.BackColor    = clr;
            txtSatLate.BackColor  = clr;
            txtSatUT.BackColor    = clr;
            #endregion
            #region " Sunday "
            shift           = new clsShift();
            shift.ShiftCode = txtSunShift.Text;
            shift.Fill();
            txtSunBS.Text = shift.BreakTimeStart.ToString("hh:mm tt");
            txtSunBE.Text = shift.BreakTimeEnd.ToString("hh:mm tt");
            if (shift.ShiftModeCode == "W")
            {
                txtSunIn.Text   = shift.TimeStart.ToString("hh:mm tt");
                txtSunHalf.Text = shift.TimeHalf.ToString("hh:mm tt");
                txtSunOut.Text  = shift.TimeEnd.ToString("hh:mm tt");
                txtSunLate.Text = shift.LateTime.ToString("hh:mm tt");
                txtSunUT.Text   = shift.UnderTime.ToString("hh:mm tt");
            }
            clr = (shift.ShiftModeCode == "W" ? Color.Honeydew : Color.MistyRose);
            txtSunShift.BackColor = clr;
            txtSunIn.BackColor    = clr;
            txtSunHalf.BackColor  = clr;
            txtSunOut.BackColor   = clr;
            txtSunBS.BackColor    = clr;
            txtSunBE.BackColor    = clr;
            txtSunLate.BackColor  = clr;
            txtSunUT.BackColor    = clr;
            #endregion
        }
示例#16
0
        private void InitializeGrid()
        {
            clsSchedule cSchedule = new clsSchedule();
            int intHeight = 0;
            int intI = 0;
            UltraGridLayout uwgLayout = this.uwgProjects.DisplayLayout;
            //
            //
            uwgLayout.RowHeightDefault = Unit.Pixel(13);
            ///''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            // Activate sorting
            this.uwgProjects.Bands[0].AllowSorting = AllowSorting.Yes;
            this.uwgProjects.Bands[0].HeaderClickAction = HeaderClickAction.SortSingle;
            //
            this.uwgProjects.Bands[0].HeaderStyle.CssClass = "ChildHeaderStyle";
            this.uwgProjects.Bands[0].FooterStyle.CssClass = "ChildFooterStyle";

            //changes the sort icons
            uwgLayout.ImageUrls.SortDescending = "./images/spacer.gif";
            uwgLayout.ImageUrls.SortAscending = "./images/spacer.gif";
            //
            // Show footer for Schedule band
            this.uwgProjects.DisplayLayout.Bands[0].ColFootersVisible = ShowMarginInfo.Yes;
            // 0
            this.uwgProjects.Bands[0].Columns.FromKey("ID").Hidden = true;
            // 1
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectID").Hidden = true;
            // 2 ProjecNo
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectNo").Header.Caption = "Job #";
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectNo").Width = Unit.Pixel(100);
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectNo").AllowUpdate = AllowUpdate.No;
            ColumnFooter cf = default(ColumnFooter);
            cf = this.uwgProjects.Bands[0].Columns.FromKey("ProjectNo").Footer;
            cf.RowLayoutColumnInfo.SpanX = 2;
            cf.Caption = "&nbsp;&nbsp;&nbsp;&nbsp;<img src='../images/GridLegend.jpg' />";
            cf.Style.HorizontalAlign = HorizontalAlign.Left;
            // 3 ProjectName
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectName").Header.Caption = "Project";
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectName").Width = Unit.Pixel(200);
            this.uwgProjects.Bands[0].Columns.FromKey("ProjectName").AllowUpdate = AllowUpdate.No;
            // Week column widths
            for (intI = 4; intI <= 23; intI++)
            {
                this.uwgProjects.Bands[0].Columns[intI].CellStyle.HorizontalAlign = HorizontalAlign.Center;
                this.uwgProjects.Bands[0].Columns[intI].Width = Unit.Pixel(35);
                this.uwgProjects.Bands[0].Columns[intI].Footer.Total = SummaryInfo.Sum;
                this.uwgProjects.Bands[0].Columns[intI].Header.Caption = WeekDate.WeekLabels[intI - 4];
                this.uwgProjects.Bands[0].Columns[intI].DataType = "System.Decimal";
                this.uwgProjects.Bands[0].Columns[intI].Header.Style.CssClass = "ChildWeekHeaderStyle";
            }
            //
            // Current Week Column
            int intCol = 0;
            bool blnCurWeek = DefaultMondayColumn(intCol);
            if (blnCurWeek)
            {
                this.uwgProjects.Bands[0].Columns[intCol].Header.Style.CssClass = "ChildCurWeekHeaderStyle";
            }
        }