private void cboProject_EditValueChanged(object sender, EventArgs e) { if (cboProject.EditValue == null) { return; } string projectCode = cboProject.EditValue.ToString(); if (projectCode != "") { try { //DataTable tbl = TextUtils.Select("Select ID, Code, Name from Modules with(nolock) where Code like '%TPAD%' and " + // " code in (SELECT MaTheoThietKe FROM [QLKHCV].[dbo].[SanPhamDA] where ProjectsID='" + projectID + "') order by Code"); string[] paraName = new string[1]; string[] paraValue = new string[1]; paraName[0] = "@ProjectCode"; paraValue[0] = projectCode; DataTable tbl = ModulesBO.Instance.LoadDataFromSP("spGetModuleOfProject", "Modules", paraName, paraValue); TextUtils.PopulateCombo(cboModule, tbl, "ProductName", "ProductCode", ""); } catch (Exception ex) { cboModule.Properties.DataSource = null; } } else { cboModule.Properties.DataSource = null; } }
private void cboProject_EditValueChanged(object sender, EventArgs e) { string projectCode = TextUtils.ToString(cboProject.EditValue); if (projectCode != "") { txtProjectCode.Text = projectCode; } if (projectCode != "") { try { string[] paraName = new string[1]; string[] paraValue = new string[1]; paraName[0] = "@ProjectCode"; paraValue[0] = projectCode; DataTable tbl = ModulesBO.Instance.LoadDataFromSP("spGetModuleOfProject", "Modules", paraName, paraValue); TextUtils.PopulateCombo(cboModule, tbl, "ProductName", "ProductCode", ""); } catch (Exception ex) { cboModule.Properties.DataSource = null; } } else { cboModule.Properties.DataSource = null; } }
void loadCombo(int id = 0) { DataTable tbl = TextUtils.Select(@"SELECT ID, Name FROM ProductGroup WITH(NOLOCK) where ID = " + id + " ORDER BY Name"); if (tbl == null) { return; } TextUtils.PopulateCombo(cboParent, tbl.Copy(), "Name", "ID", "-- CẤP LỚN NHẤT --"); }
void loadCombo(int id = 0) { DataTable tbl = TextUtils.Select(@"SELECT ID, Name FROM DesignStructure WITH(NOLOCK) ORDER BY Name"); if (tbl == null) { return; } TextUtils.PopulateCombo(cboParent, tbl.Copy(), "Name", "ID", "-- CẤP LỚN NHẤT --"); }
void loadGroup() { DataTable tbl = TextUtils.Select(@"SELECT ID,Code,Code+'-'+Name as Name FROM ProductGroup WITH(NOLOCK) ORDER BY Code"); if (tbl == null) { return; } TextUtils.PopulateCombo(cboGroup, tbl.Copy(), "Name", "ID", ""); }
void loadCombo(int id = 0) { DataTable tbl = TextUtils.Select(@"SELECT ID,Name as Name FROM FormAndFunctionGroup WITH(NOLOCK) ORDER BY Name"); if (tbl == null) { return; } TextUtils.PopulateCombo(leParentCat, tbl.Copy(), "Name", "ID", "-- CẤP LỚN NHẤT --"); }
void loadCombo() { DataTable tbl = TextUtils.Select(@"SELECT ID,Code FROM ModuleGroup WITH(NOLOCK) where ParentID = 0 ORDER BY Code"); if (tbl == null) { return; } TextUtils.PopulateCombo(leParentCat, tbl.Copy(), "Code", "ID", "--Cấp lớn nhất--"); }
void loadCombo() { DataTable tbl = LibIE.Select(@"SELECT ID,C_Code+'-'+C_Name as C_Code FROM T_DM_KMP_GROUP WITH(NOLOCK)"); if (tbl == null) { return; } TextUtils.PopulateCombo(leParentCat, tbl.Copy(), "C_Code", "ID", "--Cấp lớn nhất--"); }
void loadProject() { try { DataTable tbl = LibQLSX.Select("select * from Project"); TextUtils.PopulateCombo(cboProject, tbl, "ProjectCode", "ProjectId", ""); } catch (Exception ex) { } }
void loadDepartment() { try { DataTable tblDepartment = LibQLSX.Select("Select * from Departments a with(nolock)"); TextUtils.PopulateCombo(cboDepartment, tblDepartment.Copy(), "DName", "DepartmentId", ""); } catch { } }
void loadCustomer() { try { DataTable tbl = LibQLSX.Select("SELECT * FROM [Customers] with(nolock)"); TextUtils.PopulateCombo(cboCustomer, tbl, "CustomerName", "CustomerCode", ""); } catch (Exception ex) { } }
void loadCombo() { try { DataTable tblDepartment = TextUtils.Select("Select ID, Code, Name from Department a with(nolock)"); TextUtils.PopulateCombo(cboDepartment, tblDepartment.Copy(), "Name", "ID", ""); } catch { } }
void loadComboLoaiLoi() { try { DataTable tbl1 = TextUtils.Select("vModuleErrorType", new Expression("Type", 0)); TextUtils.PopulateCombo(cboLoiTrucQuan, tbl1, "Name", "ID", ""); } catch (Exception) { } }
void loadCombo() { try { DataTable tblPerson = TextUtils.Select("Select LoginName, FullName from Users a with(nolock)"); TextUtils.PopulateCombo(cboUser, tblPerson.Copy(), "FullName", "Loginname", ""); } catch (Exception) { } }
void loadGroup() { try { DataTable tbl = TextUtils.Select("Select *, ParentCode+' - '+ParentName as Parent,Code+' - '+Name as Name1 from vMaterialGroup with(nolock) where ParentID > 0 order by Code"); TextUtils.PopulateCombo(cboMaterialGroup, tbl, "Name1", "ID", ""); } catch (Exception ex) { } }
void loadGroup() { try { DataTable tbl = TextUtils.Select("Select * from vMaterialGroup with(nolock) order by Code"); TextUtils.PopulateCombo(cboMaterialGroupN, tbl, "Name", "ID", ""); } catch (Exception ex) { } }
void loadProject() { try { DataTable tbl = LibQLSX.Select("exec spGetAllProject"); TextUtils.PopulateCombo(cboProject, tbl, "ProjectName", "ProjectCode", ""); } catch (Exception ex) { } }
void loadHang() { try { DataTable dt = TextUtils.Select("Customer", new Expression("Type", 0)); TextUtils.PopulateCombo(cboHang, dt, "Name", "ID", ""); } catch (Exception) { MessageBox.Show("Không load được hãng vào combo"); } }
void loadComboLoaiLoi() { try { //load lỗi theo chi phí DataTable tbl2 = TextUtils.Select("ModuleErrorType", new Expression("Type", 2)); TextUtils.PopulateCombo(cboLoiChiPhi, tbl2.Copy(), "Name", "ID", ""); } catch (Exception) { } }
void loadProject() { try { //DataTable tbl = LibQLSX.Select("exec spGetAllProject"); DataTable tbl = LibQLSX.Select("select * from Project"); TextUtils.PopulateCombo(cboProject, tbl, "ProjectCode", "ProjectId", ""); } catch (Exception ex) { } //cboProject.EditValue = "P000000402"; }
void loadProject() { try { DataTable tbl = LibQLSX.Select("exec spGetAllProject"); //DataTable tbl = TextUtils.Select("Select ProjectId, ProjectName, ProjectCode,DateFinishE from ProjectSyn with(nolock) order by ProjectCode"); TextUtils.PopulateCombo(cboProject, tbl, "ProjectName", "ProjectCode", ""); cboProject.Properties.View.BestFitColumns(); } catch (Exception ex) { } }
void loadContract(string projectId) { if (projectId != "") { try { DataTable dtContract = LibQLSX.Select(string.Format("SELECT *, [ContractCode] +' - '+[ContractName] Contract FROM [dbo].[Contracts] with(nolock) where [ProjectId] = '{0}'", projectId)); TextUtils.PopulateCombo(cboContract, dtContract, "Contract", "ContractId", ""); } catch { cboContract.Properties.DataSource = null; } } }
void loadCombo() { DataTable tbl = TextUtils.Select(@"SELECT ID,Name FROM Department WITH(NOLOCK) ORDER BY Name"); if (tbl == null) { return; } TextUtils.PopulateCombo(cboDepartment, tbl.Copy(), "Name", "ID", "-- Phòng ban --"); DataTable tblPerson = TextUtils.Select("Select ID, Code, Name from UserGroup a with(nolock)"); //lkTruongNhom.Properties.DataSource = tblPerson; //lkTruongNhom.Properties.DisplayMember = "FullName"; //lkTruongNhom.Properties.ValueMember = "ID"; TextUtils.PopulateCombo(lookUpEdit1, tblPerson.Copy(), "Name", "ID", "-- Chọn nhóm --"); }
private void cboProject_EditValueChanged(object sender, EventArgs e) { try { string projectCode = TextUtils.ToString(grvProject.GetFocusedRowCellValue(colProjectCode)); txtDateP.Text = TextUtils.ToString(grvProject.GetFocusedRowCellDisplayText(colDateFinishE)); string filePath = @"\\SERVER\data2\Thietke\Luutru\Hoancong\TONG HOP GIA DAU VAO\" + projectCode + ".xls"; if (!File.Exists(filePath)) { MessageBox.Show("Không tồn tại file tổng hợp giá đầu vào cho dự án [" + projectCode + "].", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } DataTable dtData = TextUtils.ExcelToDatatableNoHeader(filePath, "Tổng hợp v1"); dtData = dtData.Select("F3 <> ''").CopyToDataTable(); TextUtils.PopulateCombo(cboModuleP, dtData, "F3", "F3", ""); } catch (Exception) { } }
void loadDepartment() { DataTable tbl = LibQLSX.Select("select * from Departments"); TextUtils.PopulateCombo(cboPhongBan, tbl, "DName", "DepartmentId", ""); }
void loadModuleTK() { DataTable dtModule = TextUtils.Select("select * from Modules with(nolock) where Code like '%tpad.%' order by Code"); TextUtils.PopulateCombo(cboModule, dtModule, "Code", "Code", ""); }
void loadModule() { DataTable tbl = TextUtils.Select("select * from Modules with(nolock) where status = 2 order by Code"); TextUtils.PopulateCombo(cboModule, tbl, "Name", "Code", ""); }