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(); }
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); }