public static DataGridViewColumn CreateColumn( DataGridViewColumnType columnType, String columnName, String columnText) { DataGridViewColumn col = null; switch (columnType) { case DataGridViewColumnType.MULTICOMBOBOX: col = new DataGridViewMultiColumnComboBoxColumn(); break; case DataGridViewColumnType.COMBOBOX: col = new DataGridViewComboBoxColumn(); break; case DataGridViewColumnType.TIME: col = new DataGridViewTimeColumn(); break; case DataGridViewColumnType.DATE: col = new DataGridViewDateTimeColumn(); break; case DataGridViewColumnType.CHECKBOX: col = new DataGridViewCheckBoxColumn(); break; case DataGridViewColumnType.NUMBER: default: col = new DataGridViewTextBoxColumn(); break; } col.DataPropertyName = columnName; col.Name = columnName; col.HeaderText = columnText; return col; }
private bool Empl_Skill_List_Init() { if (Empl_Skill_List_Exist == true) { if (tabControl1.TabPages.Contains(Empl_Skill_List_MasterDatabase.MasterDatabase_Tab) == false) { tabControl1.TabPages.Insert(tabControl1.TabPages.Count, Empl_Skill_List_MasterDatabase.MasterDatabase_Tab); } tabControl1.SelectTab("Employee_vs_Skill"); return true; } Empl_Skill_List_Exist = true; Init_Empl_Skill_Excel(); Empl_Skill_List_MasterDatabase = new MaterDatabase(OpenXL, tabControl1, "Employee_vs_Skill", SkillList_Index, MasterDatabase_Connection_Str, Empl_Skill_List_Init_Database_CMD, Empl_Skill_List_Select_CMD, 3, Empl_Skill_Excel_Struct, filterStatusLabel, showAllLabel, StatusLabel1, StatusLabel2, ProgressBar1); // Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.dataGridView_View.Columns["Line_ID"].Frozen = true; Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.GridView.BackgroundColor = Color.White; All_Skill_List = new SQL_API.SQL_ATC(MasterDatabase_Connection_Str); string sql_cmd = @"SELECT [Skill_ID] ,[Skill_Name] FROM [MDB_001_Skill_List_Tbl]"; All_Skill_List.GET_SQL_DATA(sql_cmd); DataGridViewMultiColumnComboBoxColumn col = new DataGridViewMultiColumnComboBoxColumn(); col.Name = "Skill_ID"; col.DataPropertyName = "Skill_ID"; col.ValueMember = "Skill_ID"; col.DataSource = All_Skill_List.DaTable; col.ColumnWidths = new List<string>() { "60", "150" }; if (Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.Contains("Skill_ID")) { int index = Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Skill_ID"].Index; Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.RemoveAt(index); Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.Insert(index, col); col.HeaderCell = new DataGridViewAutoFilterColumnHeaderCell(col.HeaderCell); } Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.GridView.CellValueChanged += new DataGridViewCellEventHandler(Empl_Skill_List_MasterDatabase_GridView_CellValueChanged); return true; }
private bool P002_PlanByDate_Init() { if (KeHoachSanXuatTheoNgayList_Exist == true) { if (tabControl1.TabPages.Contains(KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_Tab) == false) { tabControl1.TabPages.Insert(tabControl1.TabPages.Count, KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_Tab); } tabControl1.SelectTab("P002_PlanByDate"); return true; } KeHoachSanXuatTheoNgayList_Exist = true; Init_KeHoachSanXuatTheoNgay_Excel(); KeHoachSanXuatTheoNgayList_MasterDatabase = new MaterDatabase(OpenXL, tabControl1, "P002_PlanByDate", ProductionPlanByDate_Index, MasterDatabase_Connection_Str, KeHoachSanXuatTheoNgayList_Init_Database_CMD, KeHoachSanXuatTheoNgayList_Select_CMD, 3, KeHoachSanXuatTheoNgay_Excel_Struct, filterStatusLabel, showAllLabel, StatusLabel1, StatusLabel2, ProgressBar1); // Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.dataGridView_View.Columns["Line_ID"].Frozen = true; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.BackgroundColor = Color.White; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.Privot_BT.Visible = true; planByDateController = new PlanByDateController(KeHoachSanXuatTheoNgayList_MasterDatabase); //Dho-Fixme: Do we need to use the button "Check_BT"? PosSize possize = new PosSize(); possize.pos_x = 200; possize.pos_y = 90; PlanByDate_Create_BT = new Button_Lbl(1, KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_Tab, "Create", possize, (AnchorStyles)AnchorStyles.Left | AnchorStyles.Top); PlanByDate_Create_BT.My_Button.Click += new EventHandler(PlanByDate_Create_BT_Click); possize.pos_x = 300; possize.pos_y = 90; PlanByDate_Calculate_BT = new Button_Lbl(1, KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_Tab, "Calculate", possize, (AnchorStyles)AnchorStyles.Left | AnchorStyles.Top); PlanByDate_Calculate_BT.My_Button.Click += new EventHandler(Button_Calculte_Click); possize.pos_x = 700; possize.pos_y = 90; txtTotalRequireResource = new TextBox_Lbl(1, KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_Tab, "Total", TextBox_Type.TEXT, possize, AnchorType.LEFT); txtTotalRequireResource.My_TextBox.ReadOnly = true; txtTotalRequireResource.My_TextBox.TextAlign = HorizontalAlignment.Right; txtTotalRequireResource.My_TextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); possize.pos_x = 880; txtInterestRequireResource = new TextBox_Lbl(1, KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_Tab, "Ratio increasing", TextBox_Type.TEXT, possize, AnchorType.LEFT); txtInterestRequireResource.My_TextBox.Location = new Point(possize.pos_x + 100, possize.pos_y); txtInterestRequireResource.My_TextBox.ReadOnly = true; txtInterestRequireResource.My_TextBox.TextAlign = HorizontalAlignment.Right; txtInterestRequireResource.My_TextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dtOneShiftGroup = planByDateController.GetShiftGroup(PlanByDateController.SHIFT_GROUP_TYPE_ONE); dtThreeShiftGroup = planByDateController.GetShiftGroup(PlanByDateController.SHIFT_GROUP_TYPE_THREE); dtTwoShiftGroup = planByDateController.GetShiftGroup(PlanByDateController.SHIFT_GROUP_TYPE_TWO); //add column ShiftNamePerLine -> allow manual shiftname on line DataGridViewMultiColumnComboBoxColumn col = new DataGridViewMultiColumnComboBoxColumn(); col.Name = "ShiftNamePerLine"; col.DataPropertyName = "ShiftNamePerLine"; col.DataSource = dtThreeShiftGroup; col.ValueMember = "GroupName"; col.ColumnNames = new List<string> { "GroupName" }; col.ColumnWidths = new List<string>() { "200" }; if (KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.Contains("ShiftNamePerLine")) { int index = KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["ShiftNamePerLine"].Index; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.RemoveAt(index); KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.Insert(index, col); } //end add column ShiftNamePerLine KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.ColumnHeadersHeight = 50; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["TotalShiftPerLine"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Capacity"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Qty"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["NumOfShift"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["NumOfPerson_Per_Day"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_Qty"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_Qty"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_Qty"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["NumOfPerson_Per_Day"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["TotalShiftPerLine"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Capacity"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["NumOfShift"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Priority"].Width = 50; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_From"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_To"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_Qty"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_Main"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_From"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_To"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_Main"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_Qty"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_From"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_To"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_Qty"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_Main"].Width = 70; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["ShiftNamePerLine"].HeaderText = "Shift name per line"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["TotalShiftPerLine"].HeaderText = "Total shift per line"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["NumOfShift"].HeaderText = "Num of shift"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["NumOfPerson_Per_Day"].HeaderText = "Num Of Person Per Day"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_From"].HeaderText = "Shift_1 From"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_To"].HeaderText = "Shift_1 To"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_Qty"].HeaderText = "Shift_1 Qty"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_1_Main"].HeaderText = "Shift_1 Main"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_From"].HeaderText = "Shift_2 From"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_To"].HeaderText = "Shift_2 To"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_Qty"].HeaderText = "Shift_2 Qty"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_2_Main"].HeaderText = "Shift_2 Main"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_From"].HeaderText = "Shift_3 From"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_To"].HeaderText = "Shift_3 To"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_Qty"].HeaderText = "Shift_3 Qty"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Shift_3_Main"].HeaderText = "Shift_3 Main"; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.EditMode = DataGridViewEditMode.EditOnEnter; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.Delete_Rows_BT.Visible = true; KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.CellValueChanged += new DataGridViewCellEventHandler(KeHoachSanXuatTheoNgayList_MasterDatabase_GridView_CellValueChanged); KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.CellContentClick += new DataGridViewCellEventHandler(KeHoachSanXuatTheoNgayList_MasterDatabase_GridView_CellContentClick); KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(KeHoachSanXuatTheoNgayList_MasterDatabase_GridView_DataBindingComplete); KeHoachSanXuatTheoNgayList_MasterDatabase.MasterDatabase_GridviewTBL.GridView.CellBeginEdit += new DataGridViewCellCancelEventHandler(KeHoachSanXuatTheoNgayList_MasterDatabase_GridView_CellBeginEdit); //set role string moduleId = "P_002"; RoleHelper.SetRole(KeHoachSanXuatTheoNgayList_MasterDatabase, moduleId); PlanByDate_Create_BT.My_Button.Enabled = RoleHelper.GetCurrentUserLoginRole(UserRoleName.CREATE, moduleId); PlanByDate_Calculate_BT.My_Button.Enabled = RoleHelper.GetCurrentUserLoginRole(UserRoleName.CREATE, moduleId); return true; }
private bool P003_AssignEmpl_Init() { if (P_003_KeHoachSanXuatTheoLine_Exist == true) { if (tabControl1.TabPages.Contains(P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_Tab) == false) { tabControl1.TabPages.Insert(tabControl1.TabPages.Count, P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_Tab); } tabControl1.SelectTab("P003_AssignEmployee"); return true; } if (Running_Mode == Run_Mode.DEBUG) { P_003_KeHoachSanXuatTheoLine_Select_CMD = @"SELECT * FROM [P_003_KeHoachSanXuatTheoLine_Test] "; P_003_KeHoachSanXuatTheoLine_Init_Database_CMD = @"SELECT * FROM [P_003_KeHoachSanXuatTheoLine_Test] WHERE [Date] = ''"; } P_003_KeHoachSanXuatTheoLine_Exist = true; Init_P_003_KeHoachSanXuatTheoLine_Excel(); P_003_KeHoachSanXuatTheoLine_MasterDatabase = new MaterDatabase(OpenXL, tabControl1, "P003_AssignEmployee", P_003_KeHoachSanXuatTheoLine_INDEX, MasterDatabase_Connection_Str, P_003_KeHoachSanXuatTheoLine_Init_Database_CMD, P_003_KeHoachSanXuatTheoLine_Select_CMD, 3, P_003_KeHoachSanXuatTheoLine_Excel_Struct, filterStatusLabel, showAllLabel, StatusLabel1, StatusLabel2, ProgressBar1); // Empl_Skill_List_MasterDatabase.MasterDatabase_GridviewTBL.dataGridView_View.Columns["Line_ID"].Frozen = true; P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.BackgroundColor = Color.White; P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.Import_BT.Visible = true; P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.Delete_All_BT.Visible = false; P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.Privot_BT.Visible = true; //Dho-Fixme: Do we need to use the button "Check_BT"? PosSize possize = new PosSize(); possize.pos_x = 200; possize.pos_y = 90; PlanForLine_Create_BT = new Button_Lbl(1, P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_Tab, "Create", possize, (AnchorStyles)AnchorStyles.Left | AnchorStyles.Top); PlanForLine_Create_BT.My_Button.Click += new EventHandler(PlanForLine_Create_BT_Click); possize.pos_x = 300; possize.pos_y = 90; PlanForLine_Empl_Asign_BT = new Button_Lbl(2, P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_Tab, "Add FRU", possize, (AnchorStyles)AnchorStyles.Left | AnchorStyles.Top); PlanForLine_Empl_Asign_BT.My_Button.Click += new EventHandler(P_003_KeHoachSanXuatTheoLine_AddFRU_BT_Click); possize.pos_x = 400; possize.pos_y = 90; PlanForLine_Create_FRU_BT = new Button_Lbl(2, P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_Tab, "Assign", possize, (AnchorStyles)AnchorStyles.Left | AnchorStyles.Top); PlanForLine_Create_FRU_BT.My_Button.Click += new EventHandler(PlanForLine_Empl_Asign_BT_Click); possize.pos_x = 700; possize.pos_y = 90; PlanForLine_DuplicateRow_BT = new Button_Lbl(3, P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_Tab, "Duplicate Current Row", possize, (AnchorStyles)AnchorStyles.Left | AnchorStyles.Top); PlanForLine_DuplicateRow_BT.My_Button.Click += new EventHandler(PlanForLine_DuplicateRow_BT_Click); //Chỉ cần load danh sách nhân viên available ? //DataTable leave_info = Load_Leave_Register(date); P_003_KeHoachSanXuatTheoLine_tbAllEmployee = Load_All_Empl(); P_003_KeHoachSanXuatTheoLine_tbAllEmployee.PrimaryKey = new DataColumn[] { P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns["Empl_ID"] }; if (P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Contains("Cur_Line") == false) { P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Add("Cur_Line", typeof(String)); } if (P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Contains("Cur_Shift") == false) { P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Add("Cur_Shift", typeof(String)); } if (P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Contains("Date") == false) { P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Add("Date", typeof(DateTime)); } //P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Add("Cur_Line", typeof(String)); //P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Add("Cur_Shift", typeof(String)); //P_003_KeHoachSanXuatTheoLine_tbAllEmployee.Columns.Add("Date", typeof(DateTime)); DataGridViewMultiColumnComboBoxColumn col = new DataGridViewMultiColumnComboBoxColumn(); col.Name = "Empl_ID"; col.DataPropertyName = "Empl_ID"; col.ValueMember = "Empl_ID"; col.DataSource = P_003_KeHoachSanXuatTheoLine_tbAllEmployee; col.ColumnWidths = new List<string>() { "55", "150", "60", "50", "65" }; if (P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.Contains("Empl_ID")) { int index = P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns["Empl_ID"].Index; P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.RemoveAt(index); P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Columns.Insert(index, col); col.HeaderCell = new DataGridViewAutoFilterColumnHeaderCell(col.HeaderCell); } P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.CellValueChanged += new DataGridViewCellEventHandler(P_003_KeHoachSanXuatTheoLine_MasterDatabase_GridView_CellValueChanged); P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(P_003_KeHoachSanXuatTheoLine_MasterDatabase_GridView_DataBindingComplete); //P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.DataSourceChanged += new EventHandler(P_003_KeHoachSanXuatTheoLine_MasterDatabase_GridView_DataSourceChanged); P_003_KeHoachSanXuatTheoLine_MasterDatabase.MasterDatabase_GridviewTBL.GridView.CellBeginEdit += new DataGridViewCellCancelEventHandler(P_003_KeHoachSanXuatTheoLine_MasterDatabase_GridView_CellBeginEdit); //set role string moduleId = "P_003"; RoleHelper.SetRole(P_003_KeHoachSanXuatTheoLine_MasterDatabase, moduleId); PlanForLine_Create_BT.My_Button.Enabled = RoleHelper.GetCurrentUserLoginRole(UserRoleName.CREATE, moduleId); PlanForLine_Empl_Asign_BT.My_Button.Enabled = RoleHelper.GetCurrentUserLoginRole(UserRoleName.CREATE, moduleId); PlanForLine_Create_FRU_BT.My_Button.Enabled = RoleHelper.GetCurrentUserLoginRole(UserRoleName.CREATE, moduleId); return true; }