Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
        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 --");
        }
Esempio n. 4
0
        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 --");
        }
Esempio n. 5
0
        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", "");
        }
Esempio n. 6
0
        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 --");
        }
Esempio n. 7
0
        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--");
        }
Esempio n. 8
0
        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--");
        }
Esempio n. 9
0
 void loadProject()
 {
     try
     {
         DataTable tbl = LibQLSX.Select("select * from Project");
         TextUtils.PopulateCombo(cboProject, tbl, "ProjectCode", "ProjectId", "");
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 10
0
 void loadDepartment()
 {
     try
     {
         DataTable tblDepartment = LibQLSX.Select("Select * from Departments a with(nolock)");
         TextUtils.PopulateCombo(cboDepartment, tblDepartment.Copy(), "DName", "DepartmentId", "");
     }
     catch
     {
     }
 }
Esempio n. 11
0
 void loadCustomer()
 {
     try
     {
         DataTable tbl = LibQLSX.Select("SELECT *  FROM [Customers] with(nolock)");
         TextUtils.PopulateCombo(cboCustomer, tbl, "CustomerName", "CustomerCode", "");
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 12
0
 void loadCombo()
 {
     try
     {
         DataTable tblDepartment = TextUtils.Select("Select ID, Code, Name from Department a with(nolock)");
         TextUtils.PopulateCombo(cboDepartment, tblDepartment.Copy(), "Name", "ID", "");
     }
     catch
     {
     }
 }
Esempio n. 13
0
 void loadComboLoaiLoi()
 {
     try
     {
         DataTable tbl1 = TextUtils.Select("vModuleErrorType", new Expression("Type", 0));
         TextUtils.PopulateCombo(cboLoiTrucQuan, tbl1, "Name", "ID", "");
     }
     catch (Exception)
     {
     }
 }
Esempio n. 14
0
 void loadCombo()
 {
     try
     {
         DataTable tblPerson = TextUtils.Select("Select LoginName, FullName from Users a with(nolock)");
         TextUtils.PopulateCombo(cboUser, tblPerson.Copy(), "FullName", "Loginname", "");
     }
     catch (Exception)
     {
     }
 }
Esempio n. 15
0
 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)
     {
     }
 }
Esempio n. 16
0
 void loadGroup()
 {
     try
     {
         DataTable tbl = TextUtils.Select("Select * from vMaterialGroup with(nolock) order by Code");
         TextUtils.PopulateCombo(cboMaterialGroupN, tbl, "Name", "ID", "");
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 17
0
 void loadProject()
 {
     try
     {
         DataTable tbl = LibQLSX.Select("exec spGetAllProject");
         TextUtils.PopulateCombo(cboProject, tbl, "ProjectName", "ProjectCode", "");
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 18
0
 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");
     }
 }
Esempio n. 19
0
 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";
 }
Esempio n. 21
0
 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)
     {
     }
 }
Esempio n. 22
0
 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;
         }
     }
 }
Esempio n. 23
0
        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 --");
        }
Esempio n. 24
0
        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)
            {
            }
        }
Esempio n. 25
0
        void loadDepartment()
        {
            DataTable tbl = LibQLSX.Select("select * from Departments");

            TextUtils.PopulateCombo(cboPhongBan, tbl, "DName", "DepartmentId", "");
        }
Esempio n. 26
0
        void loadModuleTK()
        {
            DataTable dtModule = TextUtils.Select("select * from Modules with(nolock) where Code like '%tpad.%' order by Code");

            TextUtils.PopulateCombo(cboModule, dtModule, "Code", "Code", "");
        }
Esempio n. 27
0
        void loadModule()
        {
            DataTable tbl = TextUtils.Select("select * from Modules with(nolock) where status = 2 order by Code");

            TextUtils.PopulateCombo(cboModule, tbl, "Name", "Code", "");
        }