示例#1
0
        protected override string uc_Update()
        {
            string str;

            if (MyRule.Get(MyLogin.RoleId, "bbiShift") != "OK")
            {
                str = "";
            }
            else if (MyRule.AllowEdit)
            {
                // SYS_LOG.Insert("Danh Mục Ca Làm Việc", "Cập Nhật", this.txtID.Text);
                base.SetWaitDialogCaption("Đang cập nhật dữ liệu...");
                DIC_SHIFT dICSHIFT = new DIC_SHIFT(this.txtID.Text, this.txtNAME.Text, Convert.ToDateTime(this.teBeginTime.Time), Convert.ToDateTime(this.teEndTime.Time), this.cheIsOvernight.Checked, Convert.ToDateTime(this.teBeginTime1.Time), Convert.ToDateTime(this.teBeginTime2.Time), Convert.ToDateTime(this.teEndTime1.Time), Convert.ToDateTime(this.teEndTime2.Time), Convert.ToInt32(this.calLateMinute.EditValue.ToString()), Convert.ToInt32(this.calEarlyMinute.EditValue.ToString()), this.cheIsBreak.Checked, this.cheIsBreakOvernight.Checked, Convert.ToDateTime(this.teBreakBeginTime.Time), Convert.ToDateTime(this.teBreakEndTime.Time), Convert.ToInt32(this.calTotalMinute.EditValue.ToString()), Convert.ToDouble(this.calTotalHour.EditValue.ToString()), Convert.ToInt32(this.calHalfWorkMinute.EditValue.ToString()), Convert.ToInt32(this.calWorkMinute.EditValue.ToString()), Convert.ToDouble(this.cboWorkDay.EditValue.ToString()), this.cboMethodCheck.SelectedIndex, this.cheIsBOT.Checked, this.cheIsAOT.Checked, Convert.ToInt32(this.calMinimumMinuteBOT.EditValue.ToString()), Convert.ToInt32(this.calMaximumMinuteBOT.EditValue.ToString()), Convert.ToInt32(this.calDistanceMinuteBOT.EditValue.ToString()), Convert.ToInt32(this.calMinimumMinuteAOT.EditValue.ToString()), Convert.ToInt32(this.calMaximumMinuteAOT.EditValue.ToString()), Convert.ToInt32(this.calDistanceMinuteAOT.EditValue.ToString()), this.cheIsNightDutyDay.Checked, this.txtDescription.Text);
                string    str1     = dICSHIFT.Update();
                if (str1 == "OK")
                {
                    this.RaiseSuccessEventHander(dICSHIFT);
                }
                if (str1 != "OK")
                {
                    XtraMessageBox.Show(str1, "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                this.DoHide();
                str = str1;
            }
            else
            {
                MyRule.Notify();
                str = "";
            }
            return(str);
        }
示例#2
0
 public override void Change()
 {
     if (!(MyRule.Get(MyLogin.RoleId, "bbiShift") != "OK"))
     {
         if (MyRule.AllowAccess)
         {
             DIC_SHIFT dICSHIFT  = new DIC_SHIFT();
             object    cellValue = base.GetCellValue(this.m_RowClickEventArgs.RowIndex, "ShiftCode");
             if (cellValue != null)
             {
                 base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
                 if (!(dICSHIFT.Get(cellValue.ToString()) != "OK"))
                 {
                     this.DoHide();
                     xfmShiftAdd _xfmShiftAdd = new xfmShiftAdd(Actions.Update, dICSHIFT);
                     _xfmShiftAdd.Updated += new xfmShiftAdd.UpdatedEventHander(this.frm_Updated);
                     _xfmShiftAdd.Added   += new xfmShiftAdd.AddedEventHander(this.frm_Added);
                     _xfmShiftAdd.ShowDialog();
                 }
                 else
                 {
                     this.DoHide();
                     XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 }
             }
         }
         else
         {
             MyRule.Notify();
         }
     }
 }
示例#3
0
 private void RaiseSuccessEventHander(DIC_SHIFT item)
 {
     if (this.Success != null)
     {
         this.Success(this, item);
     }
 }
示例#4
0
 private void RaiseItemSelectedEventHander(DIC_SHIFT item)
 {
     if (this.ItemSelected != null)
     {
         this.ItemSelected(this, item);
     }
 }
示例#5
0
 public void RaiseUpdatedEventHander(DIC_SHIFT Item)
 {
     if (this.Updated != null)
     {
         this.Updated(this, Item);
     }
 }
示例#6
0
        protected override void Add()
        {
            base.Add();
            DIC_SHIFT dICSHIFT = new DIC_SHIFT();

            this.txtID.Text = dICSHIFT.NewID();
            this.txtNAME.Focus();
        }
示例#7
0
        public xfmShiftAdd(Actions Action)
        {
            this.InitializeComponent();
            this.Init();
            this.ucAdd.Status = Action;
            DIC_SHIFT dICSHIFT = new DIC_SHIFT();

            this.ucAdd.SetData(dICSHIFT.NewID());
            this.Text = "Thêm";
        }
示例#8
0
        private void UpdateRow(DIC_SHIFT item, RowClickEventArgs e)
        {
            AdvBandedGridView advBandedGridView = this.gbList;
            int rowIndex = e.RowIndex;

            advBandedGridView.SetRowCellValue(rowIndex, "BeginTime", item.BeginTime);
            advBandedGridView.SetRowCellValue(rowIndex, "EndTime", item.EndTime);
            advBandedGridView.SetRowCellValue(rowIndex, "ShiftCode", item.ShiftCode);
            advBandedGridView.SetRowCellValue(rowIndex, "ShiftName", item.ShiftName);
            advBandedGridView.SetRowCellValue(rowIndex, "Description", item.Description);
            advBandedGridView.UpdateCurrentRow();
            this.RaiseUpdatedEventHander(item);
        }
示例#9
0
        protected override string uc_Delete()
        {
            DIC_SHIFT dICSHIFT = new DIC_SHIFT()
            {
                ShiftCode = this.txtID.Text
            };
            string str = dICSHIFT.Delete();

            if (str == "OK")
            {
                this.RaiseSuccessEventHander(dICSHIFT);
            }
            return(str);
        }
示例#10
0
 public xfmShiftAdd(Actions Action, DIC_SHIFT Item)
 {
     this.InitializeComponent();
     this.Init();
     this.ucAdd.Status = Action;
     if (Action == Actions.Update)
     {
         this.ucAdd.SetData(Item);
         this.Text = "Cập nhật";
     }
     else if (Action == Actions.Delete)
     {
         this.ucAdd.SetData(Item.ShiftCode);
     }
 }
示例#11
0
        private void AddRow(DIC_SHIFT Item)
        {
            AdvBandedGridView advBandedGridView = this.gbList;
            int focusedRowHandle = advBandedGridView.FocusedRowHandle;

            advBandedGridView.AddNewRow();
            focusedRowHandle = advBandedGridView.FocusedRowHandle;
            advBandedGridView.SetRowCellValue(focusedRowHandle, "BeginTime", Item.BeginTime);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "EndTime", Item.EndTime);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "ShiftCode", Item.ShiftCode);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "ShiftName", Item.ShiftName);
            advBandedGridView.SetRowCellValue(focusedRowHandle, "Description", Item.Description);
            advBandedGridView.UpdateCurrentRow();
            this.RaiseAddedEventHander(Item);
        }
示例#12
0
 private void ucAdd_Success(object sender, DIC_SHIFT Item)
 {
     if (this.ucAdd.Status == Actions.Add)
     {
         this.RaiseAddedEventHander(Item);
     }
     else if (this.ucAdd.Status == Actions.Update)
     {
         this.RaiseUpdatedEventHander(Item);
     }
     if (this.ucAdd.IsClose == CloseOrNew.Close)
     {
         base.Close();
     }
     this.ucAdd.Clear();
 }
示例#13
0
        protected override void txtID_KeyDown(object sender, KeyEventArgs e)
        {
            TextEdit textEdit = (TextEdit)sender;

            if (e.KeyCode == Keys.Return | e.KeyCode == Keys.Tab)
            {
                DIC_SHIFT dICSHIFT = new DIC_SHIFT();
                if (this.m_Status == Actions.Add)
                {
                    if (dICSHIFT.Exist(textEdit.Text))
                    {
                        this.Err.SetError(textEdit, "Mã đã tồn tại.");
                        textEdit.Focus();
                    }
                }
            }
        }
示例#14
0
 public void SetData(DIC_SHIFT item)
 {
     this.txtID.Text = item.ShiftCode;
     //   SYS_LOG.Insert("Danh Mục Ca Làm Việc", "Xem", this.txtID.Text);
     if (this.m_Status == Actions.Update)
     {
         this.txtID.Properties.ReadOnly = true;
     }
     this.txtNAME.Text                   = item.ShiftName;
     this.teBeginTime.Time               = item.BeginTime;
     this.teEndTime.Time                 = item.EndTime;
     this.cheIsOvernight.Checked         = item.IsOvernight;
     this.teBeginTime1.Time              = item.BeginTime1;
     this.teBeginTime2.Time              = item.BeginTime2;
     this.teEndTime1.Time                = item.EndTime1;
     this.teEndTime2.Time                = item.EndTime2;
     this.calLateMinute.EditValue        = item.LateMinute;
     this.calEarlyMinute.EditValue       = item.EarlyMinute;
     this.cheIsBreak.Checked             = item.IsBreak;
     this.cheIsBreakOvernight.Checked    = item.IsBreakOvernight;
     this.teBreakBeginTime.Time          = item.BreakBeginTime;
     this.teBreakEndTime.Time            = item.BreakEndTime;
     this.calTotalMinute.EditValue       = item.TotalMinute;
     this.calTotalHour.EditValue         = item.TotalHour;
     this.calWorkMinute.EditValue        = item.WorkMinute;
     this.calHalfWorkMinute.EditValue    = item.HalfWorkMinute;
     this.cboWorkDay.EditValue           = item.WorkDay;
     this.cboMethodCheck.SelectedIndex   = item.MethodCheck;
     this.cheIsBOT.Checked               = item.IsBOT;
     this.cheIsAOT.Checked               = item.IsAOT;
     this.calMinimumMinuteBOT.EditValue  = item.MinimumMinuteBOT;
     this.calMaximumMinuteBOT.EditValue  = item.MaximumMinuteBOT;
     this.calDistanceMinuteBOT.EditValue = item.DistanceMinuteBOT;
     this.calMinimumMinuteAOT.EditValue  = item.MinimumMinuteAOT;
     this.calMaximumMinuteAOT.EditValue  = item.MaximumMinuteAOT;
     this.calDistanceMinuteAOT.EditValue = item.DistanceMinuteAOT;
     this.cheIsNightDutyDay.EditValue    = item.IsNightDutyDay;
     this.txtDescription.Text            = item.Description;
 }
示例#15
0
        public override void ReLoad()
        {
            base.SetWaitDialogCaption("Đang nạp dữ liệu...");
            DIC_SHIFT dICSHIFT = new DIC_SHIFT();

            this.gcList.DataSource = dICSHIFT.GetList();
            base.SetWaitDialogCaption("Đang nạp cấu hình...");
            this.List_Init(this.gbList);
            base.SetWaitDialogCaption("Nạp quyền sử dụng...");
            MyRule.Get(MyLogin.RoleId, "bbiShift");
            if (!MyRule.AllowPrint)
            {
                this.ucToolBar.bbiPrint.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiShift");
            if (!MyRule.AllowExport)
            {
                this.ucToolBar.bbiExport.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiShift");
            if (!MyRule.AllowAdd)
            {
                this.ucToolBar.bbiAdd.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiShift");
            if (!MyRule.AllowDelete)
            {
                this.ucToolBar.bbiDelete.Visibility = BarItemVisibility.Never;
            }
            MyRule.Get(MyLogin.RoleId, "bbiShift");
            if (!MyRule.AllowEdit)
            {
                this.ucToolBar.bbiEdit.Visibility = BarItemVisibility.Never;
            }
            base.SetWaitDialogCaption("Đã xong...");
            this.DoHide();
        }
示例#16
0
 private void ucList_Updated(object sender, DIC_SHIFT Item)
 {
     this.RaiseUpdatedEventHander(Item);
 }
示例#17
0
        public override void Delete()
        {
            object cellValue;

            if (!(MyRule.Get(MyLogin.RoleId, "bbiShift") != "OK"))
            {
                if (MyRule.AllowDelete)
                {
                    if (ClsOption.System2.IsQuestion)
                    {
                        if (XtraMessageBox.Show("Bạn có muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                        {
                            return;
                        }
                    }
                    base.SetWaitDialogCaption("Đang xóa...");
                    string            str  = "";
                    bool              flag = false;
                    AdvBandedGridView advBandedGridView = this.gbList;
                    int[]             selectedRows      = advBandedGridView.GetSelectedRows();
                    DIC_SHIFT         dICSHIFT          = new DIC_SHIFT();
                    for (int i = (int)selectedRows.Length; i > 0; i--)
                    {
                        flag      = true;
                        cellValue = base.GetCellValue(selectedRows[i - 1], "ShiftCode");
                        if (cellValue != null)
                        {
                            // SYS_LOG.Insert("Danh Mục Ca Làm Việc", "Xoá", cellValue.ToString());
                            str = dICSHIFT.Delete(cellValue.ToString());
                            if (str == "OK")
                            {
                                advBandedGridView.DeleteRow(selectedRows[i - 1]);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show(string.Concat("Thông tin không được xóa\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                        }
                    }
                    this.DoHide();
                    if (!flag)
                    {
                        if (advBandedGridView.DataSource != null)
                        {
                            RowClickEventArgs rowClickEventArg = new RowClickEventArgs((advBandedGridView == null ? -1 : advBandedGridView.FocusedRowHandle), (advBandedGridView.FocusedColumn == null ? -1 : advBandedGridView.FocusedColumn.ColumnHandle), (advBandedGridView.FocusedColumn == null ? "" : advBandedGridView.FocusedColumn.FieldName));
                            this.m_RowClickEventArgs = rowClickEventArg;
                            cellValue = null;
                            cellValue = base.GetCellValue(rowClickEventArg.RowIndex, "ShiftCode");
                            if (cellValue == null)
                            {
                                return;
                            }
                            // SYS_LOG.Insert("Danh Mục Ca Làm Việc", "Xoá", cellValue.ToString());
                            base.SetWaitDialogCaption("Đang xóa...");
                            str = dICSHIFT.Delete(cellValue.ToString());
                            if (str == "OK")
                            {
                                advBandedGridView.DeleteRow(rowClickEventArg.RowIndex);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show(string.Concat("Thông tin không được xóa\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                            this.DoHide();
                        }
                        else
                        {
                            return;
                        }
                    }
                    this.RaiseDeletedEventHander();
                }
                else
                {
                    MyRule.Notify();
                }
            }
        }
示例#18
0
 private void frm_Updated(object sender, DIC_SHIFT Item)
 {
     this.UpdateRow(Item, this.m_RowClickEventArgs);
 }
示例#19
0
 private void gbList_CellValueChanged(object sender, CellValueChangedEventArgs e)
 {
     if (e.Column != this.colTotalHour)
     {
         this.m_EmployeeCode = this.gbList.GetFocusedRowCellValue(this.colEmployeeCode).ToString();
         this.m_ShiftCode    = this.gbList.GetFocusedRowCellValue(this.colShiftCode).ToString();
         if (this.m_IsEditValueChanged)
         {
             try
             {
                 this.m_Hour = Convert.ToDouble(e.Value.ToString());
             }
             catch
             {
                 this.m_Hour = 0;
                 this.gbList.SetFocusedValue(0);
             }
             if (this.m_Hour > 24)
             {
                 XtraMessageBox.Show("Dữ liệu bạn nhập vào quá lớn!");
                 this.m_Hour = 0;
                 this.gbList.SetFocusedValue(0);
             }
             if (this.m_Hour < 0)
             {
                 this.m_Hour = 0;
                 this.gbList.SetFocusedValue(0);
             }
             this.m_Symbol = "+";
             this.m_IsWork = HRM_TIMEKEEPER_SHIFT.IsWork(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Date.Day);
             double    mHour    = this.m_Hour * 60;
             int       num      = int.Parse(mHour.ToString());
             DIC_SHIFT dICSHIFT = new DIC_SHIFT();
             dICSHIFT.Get(this.m_ShiftCode);
             int      year      = this.m_Date.Year;
             int      month     = this.m_Date.Month;
             int      day       = this.m_Date.Day;
             int      hour      = dICSHIFT.BeginTime.Hour;
             int      minute    = dICSHIFT.BeginTime.Minute;
             DateTime beginTime = dICSHIFT.BeginTime;
             DateTime dateTime  = new DateTime(year, month, day, hour, minute, beginTime.Second);
             int      year1     = this.m_Date.Year;
             int      month1    = this.m_Date.Month;
             int      day1      = this.m_Date.Day;
             int      hour1     = dICSHIFT.EndTime.Hour;
             int      minute1   = dICSHIFT.EndTime.Minute;
             beginTime = dICSHIFT.EndTime;
             DateTime dateTime1 = new DateTime(year1, month1, day1, hour1, minute1, beginTime.Second);
             this.m_TimeIn = dateTime;
             HRM_TIMEKEEPER_BREAK hRMTIMEKEEPERBREAK = new HRM_TIMEKEEPER_BREAK();
             double num1 = hRMTIMEKEEPERBREAK.TotalBreakHour(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Date);
             mHour          = num1 * 60;
             this.m_TimeOut = MyDateTime.AddMinute(this.m_TimeIn, num + int.Parse(mHour.ToString()));
             HRM_TIMEKEEPER hRMTIMEKEEPER = new HRM_TIMEKEEPER();
             hRMTIMEKEEPER.Get(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Symbol, this.m_Date, this.m_TimeIn, this.m_TimeOut);
             this.m_TimeIn      = hRMTIMEKEEPER.TimeIn;
             this.m_TimeOut     = hRMTIMEKEEPER.TimeOut;
             this.m_Hour        = hRMTIMEKEEPER.Hour;
             this.m_DayHour     = hRMTIMEKEEPER.DayHour;
             this.m_NightHour   = hRMTIMEKEEPER.NightHour;
             this.m_LateMinute  = hRMTIMEKEEPER.LateMinute;
             this.m_EarlyMinute = hRMTIMEKEEPER.EarlyMinute;
             DataRowCollection rows = this.dt_Timekeeper.Rows;
             object[]          mTimeKeeperTableListID = new object[] { this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Date, this.m_Symbol, this.m_TimeIn, this.m_TimeOut, this.m_Hour, this.m_DayHour, this.m_NightHour, 0, this.m_LateMinute, this.m_EarlyMinute, this.m_IsOvertime, this.m_IsWork, 0, "" };
             rows.Add(mTimeKeeperTableListID);
             this.SaveData();
             if (this.m_IsSetRowCellValue)
             {
                 this.SetRowCellValue(e.RowHandle, this.m_EmployeeCode);
             }
             else
             {
                 this.m_IsSetRowCellValue = true;
             }
         }
         else
         {
             this.m_IsEditValueChanged = true;
             this.SetRowCellValue(e.RowHandle, this.m_EmployeeCode);
         }
     }
 }
示例#20
0
        public void SetData(HRM_TIMEKEEPER item)
        {
            //   SYS_LOG.Insert("Giờ Làm Việc", "Xem", item.ShiftCode.ToString());
            this.m_TimeKeeperTableListID = item.TimeKeeperTableListID;
            this.m_EmployeeCode          = item.EmployeeCode;
            HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE();

            hRMEMPLOYEE.Get(this.m_EmployeeCode);
            GroupControl groupControl = this.groupControl1;

            string[] firstName = new string[] { "Thông Tin Ra/Vào - ", hRMEMPLOYEE.FirstName, " ", hRMEMPLOYEE.LastName, " (", hRMEMPLOYEE.EmployeeCode, ") - ", item.Symbol };
            groupControl.Text = string.Concat(firstName);
            this.m_ShiftCode  = item.ShiftCode;
            this.m_Date       = item.Date;
            this.m_Symbol     = item.Symbol;
            DIC_SHIFT dICSHIFT = new DIC_SHIFT();

            dICSHIFT.Get(this.m_ShiftCode);
            this.txtShift.Text            = dICSHIFT.ShiftName;
            this.dtDate.DateTime          = item.Date;
            this.txtSymbol.Text           = item.Symbol;
            this.m_IsFirstLoad            = true;
            this.teTimeIn.EditValue       = item.TimeIn;
            this.m_IsFirstLoad            = true;
            this.teTimeOut.EditValue      = item.TimeOut;
            this.calHour.EditValue        = item.Hour;
            this.calDayHour.EditValue     = item.DayHour;
            this.calNightHour.EditValue   = item.NightHour;
            this.calLateMinute.EditValue  = item.LateMinute;
            this.calEarlyMinute.EditValue = item.EarlyMinute;
            this.m_IsOverTime             = item.IsOverTime;
            this.m_IsWork            = item.IsWork;
            this.m_Sorted            = item.Sorted;
            this.txtDescription.Text = item.Description;
            HRM_TIMEKEEPER_BREAK hRMTIMEKEEPERBREAK = new HRM_TIMEKEEPER_BREAK();
            double num = hRMTIMEKEEPERBREAK.TotalBreakHour(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Date);

            this.bbiTimekeepingBreak.Text = string.Concat("(", num.ToString(), "h)");
            if (num <= 0)
            {
                this.bbiTimekeepingBreak.ButtonStyle = BorderStyles.Simple;
            }
            else
            {
                this.bbiTimekeepingBreak.ButtonStyle = BorderStyles.Office2003;
                HRM_TIMEKEEPER_EXTRA hRMTIMEKEEPEREXTRA = new HRM_TIMEKEEPER_EXTRA();
                double num1 = hRMTIMEKEEPEREXTRA.TotalExtraHour(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Date);
                this.bbiTimekeepingExtra.Text = string.Concat("(", num1.ToString(), "h)");
                if (num1 <= 0)
                {
                    this.bbiTimekeepingExtra.ButtonStyle = BorderStyles.Simple;
                }
                else
                {
                    this.bbiTimekeepingExtra.ButtonStyle = BorderStyles.Office2003;
                }
                HRM_TIMEKEEPER_PRIVATE hRMTIMEKEEPERPRIVATE = new HRM_TIMEKEEPER_PRIVATE();
                double num2 = hRMTIMEKEEPERPRIVATE.TotalPrivateHour(this.m_TimeKeeperTableListID, this.m_EmployeeCode, this.m_ShiftCode, this.m_Date);
                this.bbiTimekeepingPrivate.Text = string.Concat("(", num2.ToString(), "h)");
                if (num2 <= 0)
                {
                    this.bbiTimekeepingPrivate.ButtonStyle = BorderStyles.Simple;
                }
                else
                {
                    this.bbiTimekeepingPrivate.ButtonStyle = BorderStyles.Office2003;
                }
            }
        }
示例#21
0
        public void Init(bool IsShowLateEarly, bool IsShowShift)
        {
            DIC_SYMBOL dICSYMBOL = new DIC_SYMBOL();

            this.flowLayoutPanel1.Controls.Clear();
            this.flowLayoutPanel2.Controls.Clear();
            foreach (DataRow row in dICSYMBOL.GetList().Rows)
            {
                if (bool.Parse(row["IsShow"].ToString()))
                {
                    string str = "";
                    if (!(row["SymbolCode"].ToString() == ""))
                    {
                        str = ((row["SymbolCode"].ToString() == "CS" || row["SymbolCode"].ToString() == "KCR" ? false : !(row["SymbolCode"].ToString() == "KCV")) ? row["SymbolCode"].ToString() : string.Concat("<color=red>", row["SymbolCode"].ToString(), "</color>"));
                    }
                    else
                    {
                        str = "(trống)";
                    }
                    xucSymbolItem _xucSymbolItem = new xucSymbolItem()
                    {
                        Height     = 13,
                        SymbolCode = string.Concat(":  ", str),
                        SymbolName = row["SymbolName"].ToString()
                    };
                    this.flowLayoutPanel1.Controls.Add(_xucSymbolItem);
                }
            }
            bool isShowLateEarly = IsShowLateEarly;
            bool flag            = isShowLateEarly;

            this.m_IsShowLateEarly = isShowLateEarly;
            if (flag)
            {
                xucSymbolItem _xucSymbolItem1 = new xucSymbolItem()
                {
                    Height     = 13,
                    SymbolCode = ":  +(số phút)",
                    SymbolName = "Số phút đi trễ"
                };
                this.flowLayoutPanel1.Controls.Add(_xucSymbolItem1);
                xucSymbolItem _xucSymbolItem2 = new xucSymbolItem()
                {
                    Height     = 13,
                    SymbolCode = ":  -(số phút)",
                    SymbolName = "Số phút về sớm"
                };
                this.flowLayoutPanel1.Controls.Add(_xucSymbolItem2);
                xucSymbolItem _xucSymbolItem3 = new xucSymbolItem()
                {
                    Height     = 13,
                    SymbolCode = ": +(sp):-(sp)",
                    SymbolName = "Đi trễ, về sớm"
                };
                this.flowLayoutPanel1.Controls.Add(_xucSymbolItem3);
                xucSymbolItem _xucSymbolItem4 = new xucSymbolItem()
                {
                    Height     = 13,
                    SymbolCode = ": <color=black>+;V +;P ...</color>",
                    SymbolName = "<color=black>Tách đôi ca</color>"
                };
                this.flowLayoutPanel1.Controls.Add(_xucSymbolItem4);
            }
            bool isShowShift = IsShowShift;

            flag = isShowShift;
            this.m_IsShowShift = isShowShift;
            if (!flag)
            {
                this.flowLayoutPanel2.Height = 0;
            }
            else
            {
                this.flowLayoutPanel2.Height = 17;
                DIC_SHIFT    dICSHIFT     = new DIC_SHIFT();
                LabelControl labelControl = new LabelControl()
                {
                    Text = "* Ký hiệu theo ca: "
                };
                this.flowLayoutPanel2.Controls.Add(labelControl);
                foreach (DataRow dataRow in dICSHIFT.GetList().Rows)
                {
                    xucSymbolItem _xucSymbolItem5 = new xucSymbolItem()
                    {
                        Height = 13,
                        Width  = 184
                    };
                    _xucSymbolItem5.lbSymbolCode.Width = 46;
                    _xucSymbolItem5.SymbolCode         = string.Concat(":  <color=blue>", dataRow["ShiftCode"].ToString(), "</color>");
                    string[] shortTimeString = new string[] { "<u>", dataRow["ShiftName"].ToString(), " <i>(", null, null, null, null };
                    DateTime dateTime        = Convert.ToDateTime(dataRow["BeginTime"]);
                    shortTimeString[3]         = dateTime.ToShortTimeString();
                    shortTimeString[4]         = " - ";
                    dateTime                   = Convert.ToDateTime(dataRow["EndTime"]);
                    shortTimeString[5]         = dateTime.ToShortTimeString();
                    shortTimeString[6]         = ")</i></u>";
                    _xucSymbolItem5.SymbolName = string.Concat(shortTimeString);
                    SuperToolTip          superToolTip = new SuperToolTip();
                    ToolTipItemCollection items        = superToolTip.Items;
                    shortTimeString    = new string[] { dataRow["ShiftName"].ToString(), " (", null, null, null, null, null };
                    dateTime           = Convert.ToDateTime(dataRow["BeginTime"]);
                    shortTimeString[2] = dateTime.ToShortTimeString();
                    shortTimeString[3] = " - ";
                    dateTime           = Convert.ToDateTime(dataRow["EndTime"]);
                    shortTimeString[4] = dateTime.ToShortTimeString();
                    shortTimeString[5] = "): ";
                    shortTimeString[6] = dataRow["ShiftCode"].ToString();
                    items.AddTitle(string.Concat(shortTimeString));
                    if (Convert.ToBoolean(dataRow["IsOvernight"].ToString()))
                    {
                        superToolTip.Items.Add("- Làm việc qua đêm");
                    }
                    if (!Convert.ToBoolean(dataRow["IsBreak"].ToString()))
                    {
                        superToolTip.Items.Add("- Không nghỉ giữa ca");
                    }
                    else
                    {
                        ToolTipItemCollection toolTipItemCollection = superToolTip.Items;
                        dateTime = Convert.ToDateTime(dataRow["BreakBeginTime"]);
                        string shortTimeString1 = dateTime.ToShortTimeString();
                        dateTime = Convert.ToDateTime(dataRow["BreakEndTime"]);
                        toolTipItemCollection.Add(string.Concat("- Nghỉ giữa ca từ ", shortTimeString1, " - ", dateTime.ToShortTimeString()));
                    }
                    _xucSymbolItem5.lbSymbolName.SuperTip = superToolTip;
                    this.flowLayoutPanel2.Controls.Add(_xucSymbolItem5);
                }
            }
            SimpleButton simpleButton = new SimpleButton()
            {
                Text  = "Chỉnh Sửa Bảng Ký Hiệu Chấm Công",
                Width = 200
            };

            simpleButton.Click += new EventHandler(this.bt_Click);
            this.flowLayoutPanel1.Controls.Add(simpleButton);
        }
示例#22
0
 private void frm_Added(object sender, DIC_SHIFT e)
 {
     this.AddRow(e);
 }