Exemplo n.º 1
0
 private void EmpReport_Load(object sender, EventArgs e)
 {
     Class.btnControl btnemp = new Class.btnControl();
     btnemp.BtnControl(txtEmployer, "Employer");
     Class.btnControl btnFm = new Class.btnControl();
     btnFm.BtnControl(txtFmId, "CardFormula");
 }
Exemplo n.º 2
0
 private void CardReceive_Load(object sender, EventArgs e)
 {
     Class.btnControl btnemp = new Class.btnControl();
     Class.btnControl btnformula = new Class.btnControl();
     btnemp.BtnControl(txtEmployer, "Employer");//กำหนดรูปแบบปุ่มการใช้งานเพื่อเรียกใช้ฟังก์ชัน designfunction ข้อมูลเรือนจำ
     btnformula.BtnControl(txtFmId, "CardFormula");//กำหนดรูปแบบปุ่มการใช้งานเพื่อเรียกใช้ฟังก์ชัน designfunction ข้อมูลสูตรผลิต
 }
Exemplo n.º 3
0
 /*ปิด textbox กรณีเลือก combobox*/
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     switch (comboBox1.SelectedIndex)
     {
         case 0:
             Class.btnControl btn = new Class.btnControl();
             btn.BtnControl(textBox1, "Supplier");
             textBox1.Visible = true;
             textBox1.Dock = DockStyle.Fill;
             textBox1.Focus();
             textBox2.Visible = false;
             textBox3.Visible = false;
             textBox4.Visible = false;
             textBox5.Visible = false;
             break;
         case 1:
             Class.btnControl btn2 = new Class.btnControl();
             btn2.BtnControl(textBox2, "Product");
             textBox1.Visible = false;
             textBox2.Visible = true;
             textBox2.Dock = DockStyle.Fill;
             textBox2.Focus();
             textBox3.Visible = false;
             textBox4.Visible = false;
             textBox5.Visible = false;
             break;
         case 2:
             Class.btnControl btn3 = new Class.btnControl();
             btn3.BtnControl(textBox3, "Shipper");
             textBox1.Visible = false;
             textBox2.Visible = false;
             textBox3.Visible = true;
             textBox3.Dock = DockStyle.Fill;
             textBox3.Focus();
             textBox4.Visible = false;
             textBox5.Visible = false;
             break;
         case 3:
             textBox1.Visible = false;
             textBox2.Visible = false;
             textBox3.Visible = false;
             textBox4.Visible = true;
             textBox4.Dock = DockStyle.Fill;
             textBox4.Focus();
             textBox5.Visible = false;
             break;
         case 4:
             textBox1.Visible = false;
             textBox2.Visible = false;
             textBox3.Visible = false;
             textBox4.Visible = false;
             textBox5.Visible = true;
             textBox5.Dock = DockStyle.Fill;
             textBox5.Focus();
             break;
     }
 }
Exemplo n.º 4
0
        private void CheckRequirementManage_Load(object sender, EventArgs e)
        {
            Class.btnControl btnFm = new Class.btnControl();
            btnFm.BtnControl(txtContractor, "username");
            String UserName = clsCash.sUserIdLogin;

            string sqlPermission = "USE KTC SELECT COUNT(UserName)UserName FROM REQUESTUSER WHERE ClaimId = 2 AND UserName = '******'";
            DataTable dtPermission = Class.DBConnString.clsDB.QueryDataTable(sqlPermission);
            int Permission = Convert.ToInt16(dtPermission.Rows[0]["UserName"].ToString());

            if (Permission < 1) { toolStripButton3.Enabled = false; }
            else { toolStripButton3.Enabled = true; }
        }
Exemplo n.º 5
0
 private void AddBankBranch_Load(object sender, EventArgs e)
 {
     Class.btnControl btn = new Class.btnControl();
     btn.BtnControl(textBox1, "Employer");
     Class.Function.LoadDataCate(comboBox1, "select * from bank", "bankId", "bankName");
     Class.Function.LoadDataCate(comboBox2, "select bankbranchId,bankbranchName from bankbranch","bankbranchId", "bankbranchName");
     Class.Function.LoadDataCate(comboBox3, "select * from [BANKTYPE]", "BankTypeId", "BankTypeName");
     textBox2.Text = ID;
     textBox1.Text = "[" + strSid + "] " + strSname;
     comboBox1.Text = strBank;
     comboBox2.Text = strMajor;
     textBox3.Text = strAname;
     textBox4.Text = strDes;
     comboBox3.Text = strType;
 }
Exemplo n.º 6
0
 /*กำหนดปุ่มการทำงานเรียกใช้ฟังก์ชัน*/
 private void call_function()
 {
     Class.btnControl btcus = new Class.btnControl();
     btcus.BtnControl(textBox5, "Customer");
     ///////////
     Class.btnControl btpro = new Class.btnControl();
     btpro.BtnControl(textBox4, "Product");
     ///////////
     Class.btnControl sup = new Class.btnControl();
     sup.BtnControl(textBox6, "Supplier");
     ///////////
     Class.Function.LoadDataCate(comboBox1,
         "select 0 as saleheadstatusid,'ทั้งหมด' as saleheadstatusname union all select * from SALEHEADSTATUS where saleheadstatusid not in(3) ",
         "saleheadstatusid", "saleheadstatusname");
 }
Exemplo n.º 7
0
        private void LeadTime_Load(object sender, EventArgs e)
        {
            Class.btnControl btws = new Class.btnControl();//กำหนดปุ่มการทำงาน
            btws.BtnControl(txtWeekStart, "Week");
            Class.btnControl btwe = new Class.btnControl();//กำหนดปุ่มการทำงาน
            btwe.BtnControl(txtWeekEnd, "Week");

            rdoYear.Checked = true;
            rdoTri.Checked = false;
            rdoMonth.Checked = false;
            rdoWeek.Checked = false;
            rdoDay.Checked = false;

            int i = 0;
            foreach (string s in month)
            {
                cboMonthStart.Items.Add(new ComboboxItem { Text = s, Value = i });
                i++;
            }
            cboMonthStart.SelectedIndex = 0;

            int j = 0;
            foreach (string s in month)
            {
                cboMonthEnd.Items.Add(new ComboboxItem { Text = s, Value = j });
                j++;
            }
            cboMonthEnd.SelectedIndex = 0;

            int k = 0;
            foreach (string t in trimas)
            {
                cboTriStart.Items.Add(new ComboboxItem { Text = t, Value = k });
                k++;
            }
            cboTriStart.SelectedIndex = 0;

            int z = 0;
            foreach (string t in trimas)
            {
                cboTriEnd.Items.Add(new ComboboxItem { Text = t, Value = z });
                z++;
            }
            cboTriEnd.SelectedIndex = 0;
        }
Exemplo n.º 8
0
        void setFirstLoad()/*ตั้งค่าเริ่มต้นการใช้งานเมื่อเปิด form*/
        {
            tabControl1.TabPages.Remove(tabPage2);
            string sqlTax = "select * from Tax where tax_auto_id not in(5,6)";
            Class.Function.LoadDataCate(comboBox3, sqlTax, "tax_auto_id", "tax_type");
            ///// ลูกค้า
            Class.btnControl btcus = new Class.btnControl();
            btcus.BtnControl(textBox13, "Customer");

            textBox1.Text = saleSOid();
            ////// accountid 
            Class.btnControl bk = new btnControl();
            bk.BtnControl(textBox26, "TRCustomer2");
            ////// bank
            string sqlBank = "SELECT BankId,BankName FROM Bank";
            Class.Function.LoadDataCate(comboBox6, sqlBank, "BankId", "BankName");

            string sqlreason = "SELECT ReTypeId,ReTypeName FROM RE_REASON_TYPE";
            Class.Function.LoadDataCate(comboBox1, sqlreason, "ReTypeId", "ReTypeName");
        }
Exemplo n.º 9
0
        private void InvoiceOriginalRe_Load(object sender, EventArgs e)
        {
            tabControl1.TabPages.RemoveAt(4);
            tabControl1.TabPages.RemoveAt(4);
            tabControl1.TabPages.RemoveAt(4);
            tabControl1.TabPages.RemoveAt(4);

            setFirstLoad();
            if (head == null)
            {
                getNewId();
            }
            else
            {
                getFromManage(head);
            }
            if (clsCash.IsPermissionId("P39") == false)
            {
                button1.Enabled = false;
            }
            else
            {
                if (iSta == "ยกเลิก")
                {
                    button1.Enabled = false;
                }
                else
                {
                    if (iConf == "อนุมัติ")
                    {
                        button1.Enabled = false;
                    }
                    else { button1.Enabled = true; }
                }
            }
            Class.btnControl btShipp = new Class.btnControl();
            btShipp.BtnControl(txtShip, "AShipper");
        }
Exemplo n.º 10
0
        private void AddOwnAccount2_Load(object sender, EventArgs e)
        {
            Class.btnControl btn = new Class.btnControl();
            btn.BtnControl(textBox1, "testfunction");

            Class.Function.LoadDataCate(comboBox1, "select * from bank ", "bankId", "bankName");
            Class.Function.LoadDataCate(comboBox2, "select bankbranchId,bankbranchName from bankbranch", "bankbranchId", "bankbranchName");
            Class.Function.LoadDataCate(comboBox3, "select * from [BANKTYPE]", "BankTypeId", "BankTypeName");

            if (ID != "")
            {
                txtBankBookCode.Text = ID;
                textBox1.Text = strName;
                textBox1.Enabled = false;
                textBox2.Text = strAccNumber;
                textBox3.Text = strAccName;
                comboBox3.Text = strType;
                comboBox2.Text = strbname;
                comboBox1.Text = strbn;
                textBox4.Text = strDes;
            }
            else { textBox1.Enabled = true; }
            //LoadValue();
        }
Exemplo n.º 11
0
 private void ProductionPeapleWait_Load(object sender, EventArgs e)
 {
     //dateTimePicker1.Value = Convert.ToDateTime(Class.DBConnString.clsDB.QueryExecuteScalarNonAlert("SELECT GETDATE()"));
     if (EditId != "")
     {
         txtWaitId.Text = EditId.Trim();
     }
     else
     {
         txtWaitId.Text = loadId();
     }
     //Class.btnControl btcus = new Class.btnControl();//กำหนดปุ่มการทำงาน
     //btcus.BtnControl(textBox3, "Customer");
     Class.btnControl btsup = new Class.btnControl();//กำหนดปุ่มการทำงาน
     btsup.BtnControl(textBox3, "Supplier");
 }
Exemplo n.º 12
0
        private void ReturnMaterial_Load(object sender, EventArgs e)
        {
            Class.btnControl btEmployer = new Class.btnControl();
            btEmployer.BtnControl(txtEmployer, "Employer");//เรียกใช้ฟังก์ชัน designfunction
            Class.btnControl btShip = new Class.btnControl();
            btShip.BtnControl(txtShip, "Shipper");//เรียกใช้ฟังก์ชัน designfunction
            Class.btnControl btFmId = new Class.btnControl();
            btFmId.BtnControl(txtFmId, "FormuLar");//เรียกใช้ฟังก์ชัน designfunction

            loadingfirst();

            if (clsCash.IsPermissionId("P47") == false)
            {
                toolStripButton3.Enabled = false;
                toolStripButton5.Enabled = false;
            }
            else
            {
                toolStripButton3.Enabled = true;
                toolStripButton5.Enabled = true;
            }
        }
Exemplo n.º 13
0
        private void loadChecking(String w = "")
        {
            dataGridView1.DataSource = null;
            dataGridView2.DataSource = null;
            dataGridView3.DataSource = null;
            label1.Text = "ค้นใบตรวจ";
            label2.Text = "สินค้าเสีย";
            label4.Text = "สินค้าดี";
            Class.btnControl btne = new Class.btnControl();
            Class.btnControl btns = new Class.btnControl();
            btne.BtnControl(textBox2, "NettingFail");//เรียกใช้ฟังก์ชัน designfunction ประเภทอวนเสีย
            btns.BtnControl(textBox4, "Product");//เรียกใช้ฟังก์ชัน designfunction รายการสินค้า
            //tableLayoutPanel2.SetColumnSpan(dataGridView2, 1);
            //dataGridView3.Visible = true;
            //dataGridView3.Dock = DockStyle.Fill;
            TableLayoutColumnStyleCollection columnStyles = tableLayoutPanel2.ColumnStyles;
            //columnStyles[2].Width =200;

            String sql = "select c.productioncheckdate,c.ProductionCheckId,c.ProductionWaitId,wh.ProductionWaitDate,c.ProductionWaitdetailId,ey.employername,c.FmId,f.fmName,c.Quantity,c.NetWell,c.NetFail,c.NetDiff,c.NetLost,cc.confirmname,case when c.productioncheckstatusid = 0 then 'ปกติ' else 'ยกเลิก' end as productioncheckstatusid " +
            "from ProductionCheck c inner join productionformular f on f.fmid = c.fmid inner join confirm cc on c.confirmid = cc.confirmid inner join productionwaithead wh on wh.ProductionWaitId = c.ProductionWaitId inner join employer ey on ey.employerid = wh.employerid " +w;

            DataTable dt = Class.DBConnString.clsDB.QueryDataTable(sql);
            dataGridView1.DataSource = dt;
            loadCheckingHead();
            if (dt.Rows.Count<1) return;
            sql = "select w.ProductionCheckWellId,w.ProductionCheckId,w.ProductId,p.ProductName,w.Quantity,u.UnitSaleName,"+
            " (select f.fmid from productionformular f inner join productiondraw_head ph on f.fmid = ph.fmid where ph.newproductionid = w.newproductionid) as fmid,"+
            " (select f.fmname from productionformular f inner join productiondraw_head ph on f.fmid = ph.fmid where ph.newproductionid = w.newproductionid) as fmname,w.newproductionid as id,pcs.productioncheckstatusname from ProductionCheckWell w " +
            "inner join product p on w.productid = p.productid inner join unitsale u on p.unitsaleid = u.unitsaleid inner join productioncheckstatus pcs on w.productioncheckstatusid = pcs.productioncheckstatusid where w.ProductionCheckId = " +
            dt.Rows[0]["ProductionCheckId"].ToString();
            dataGridView2.DataSource = Class.DBConnString.clsDB.QueryDataTable(sql);//ดึงข้อมูลเก็บใน Datagridview
            sql = "select w.ProductionCheckFailId,w.ProductionCheckId,w.NetFId,p.NetFName,w.Quantity,"+
            "(select f.fmid from productionformular f inner join productiondraw_head ph on f.fmid = ph.fmid where ph.newproductionid = w.newproductionid) as fmid," +
            "(select f.fmname from productionformular f inner join productiondraw_head ph on f.fmid = ph.fmid where ph.newproductionid = w.newproductionid) as fmname,w.newproductionid as id,pcs.productioncheckstatusname from ProductionCheckFail w " +
            "inner join productionnettingfail p on w.NetFId = p.NetFId inner join productioncheckstatus pcs on w.productioncheckstatusid = pcs.productioncheckstatusid where w.ProductionCheckId = " +
            dt.Rows[0]["ProductionCheckId"].ToString();
            dataGridView3.DataSource = Class.DBConnString.clsDB.QueryDataTable(sql);//ดึงข้อมูลเก็บใน Datagridview
            loadCheckingWell();
            loadCheckingFail();
        }
Exemplo n.º 14
0
 private void ReportComplete_Load(object sender, EventArgs e)
 {
     Class.btnControl btReq = new Class.btnControl();//กำหนดปุ่มการทำงาน
     btReq.BtnControl(txtReqId, "Req");
 }
Exemplo n.º 15
0
 private void loadFirst()
 {
     dptRecDate.Value = Class.DBConnString.toDay;
     textBox3.Text = round(Class.Function.GetDate(dptRecDate.Value));
     BtnCustomerControlTxtProductName();
     //txtInvoice.Text = ""; //Class.clsCash.sUserLogin;
      b = new Class.btnControl();
     b.BtnControl(textBox4, "Stock",stock);
 }
Exemplo n.º 16
0
        private void ProductionChecking_Load(object sender, EventArgs e)
        {
            dgvQty.AutoGenerateColumns = true;
            textBox1.Text = ProductionId();
            Class.btnControl btnE = new Class.btnControl();
            btnE.BtnControl(txtVillager, "Supplier");
            //dateTimePicker1.Value = Convert.ToDateTime(Class.DBConnString.clsDB.QueryExecuteScalarNonAlert("SELECT GETDATE()"));

            //if (Id != "") {
            //    loadValues();
            //}else{
            //    loadFirst();
            //}
        }
Exemplo n.º 17
0
        private void ProductionBackNew_Load(object sender, EventArgs e)
        {
            dtpDate.Value = Convert.ToDateTime(Class.DBConnString.clsDB.QueryExecuteScalarNonAlert("SELECT GETDATE()"));

            Class.btnControl btShipp = new Class.btnControl();
            btShipp.BtnControl(txtSupplier, "Supplier");
            txtDrawHeadId.Text = ProductionDrawEmployerId();

            if (head == "")
            {
                txtDrawHeadId.Text = ProductionDrawEmployerId();
            }
            else
            {

            }
        }
Exemplo n.º 18
0
 /*เริ่มต้นเข้าใช้งานใน form*/
 private void loadFirst()
 {
     txtRec.Text = loadId();
     Class.btnControl btnE = new Class.btnControl();
     BtnProductNameControlTxtProductName();
     btnE.BtnControl(txtEmp, "Employer");
     dgvReceive.ColumnCount = 7;
     dgvReceive.Columns[0].Name = "productioncheckfailId";
     dgvReceive.Columns[0].HeaderText = "รหัสใบรอซ่อม";
     dgvReceive.Columns[1].Name = "FmId";
     dgvReceive.Columns[1].HeaderText = "รหัสสูตร";
     dgvReceive.Columns[2].Name = "FmName";
     dgvReceive.Columns[2].HeaderText = "ชื่อสูตร";
     dgvReceive.Columns[3].Name = "NetFName";
     dgvReceive.Columns[3].HeaderText = "ประเภทอวนผิด";
     dgvReceive.Columns[4].Name = "SendQuantity";
     dgvReceive.Columns[4].HeaderText = "จำนวนส่งได้";
     dgvReceive.Columns[5].Name = "Quantity";
     dgvReceive.Columns[5].HeaderText = "จำนวน";
     dgvReceive.Columns[6].Name = "Remark";
     dgvReceive.Columns[6].HeaderText = "หมายเหตุ";/*กำหนด column name และ headertext ของ datagridview*/
     if (Id != "") {
         String sql = "select *,e.employername from ProductionRepairHead p inner join employer e on p.employerid = e.employerid " +
             "where ProductionRepairHeadId = '"+Id+"'";
         DataTable dt = Class.DBConnString.clsDB.QueryDataTable(sql);
         txtRec.Text = dt.Rows[0]["ProductionRepairHeadId"].ToString();//เลขที่ใบซ่อม
         txtEmp.Text = "[" + dt.Rows[0]["employerid"].ToString() + "] " + dt.Rows[0]["employername"].ToString();//ข้อมูลเรือนจำ
         dptRecDate.Value = Convert.ToDateTime(dt.Rows[0]["ProductionRepairHeadDate"]);//วันที่ซ่อม
         TxtDescription.Text = dt.Rows[0]["Remark"].ToString();//หมายเหตุ
         if (dt.Rows[0]["ProductionSendProductId"].ToString() == "0")//สถานที่ส่งอวนซ่อม
         {
             radioButton1.Checked = true;
         }
         else { radioButton2.Checked = true; }
         sql = "select d.*,fm.netfname,fl.fmname,(isnull(pf.Quantity,0) - isnull(pf.QuantityReceive,0)) + isnull(d.Quantity,0) as qty " +
         "from ProductionRepairDetail d inner join productioncheckfail pf ON pf.ProductionCheckFailId = d.ProductionCheckFailId INNER JOIN "+
         "dbo.ProductionNettingFail fm on pf.netfid = fm.NetFId inner join productionformular fl on fl.fmid = d.fmid where d.ProductionRepairHeadId = '"+Id+"'";
         DataTable dd = Class.DBConnString.clsDB.QueryDataTable(sql);
         foreach (DataRow d in dd.Rows) {
             dgvReceive.Rows.Add(d["productioncheckfailId"].ToString(),d["fmid"].ToString(),d["fmname"].ToString(), d["netfname"].ToString(), d["qty"].ToString(), d["Quantity"].ToString(), d["Remark"].ToString());
         }
     }
 }
Exemplo n.º 19
0
 private void frmMakingNetsWage_Load(object sender, EventArgs e)
 {
     toolStripSeparator1.Visible = false;
     toolStripLabel1.Visible = false;
     toolStripTextBox1.Visible = false;
     Class.btnControl btne = new Class.btnControl();
     btne.BtnControl(txtJ, "Employer");//เรียกใช้ฟังก์ชัน designfunction ข้อมูลเรือนจำ
     InitColumnsHead();
     InitColumnsItem();
     InitColumnsCard();
     LoadFirst();
 }
Exemplo n.º 20
0
 private void TranferManage_Load(object sender, EventArgs e)
 {
     //String sql = "select 0 as GrStockDetailId,'ทั้งหมด' as GrStockDetailLName UNION ALL select gsd.GrStockDetailId,gsd.GrStockDetailLName FROM dbo.GrStockDetail gsd WHERE gsd.GrStockId = 1 ";
     //Class.Function.LoadDataCate(toolStripComboBox1.ComboBox, sql, "GrStockDetailId", "GrStockDetailLName");
     //if(!Class.clsCash.IsPermissionId("P16")){
         //toolStripButton3.Enabled = false;
     //}
     Class.btnControl s = new Class.btnControl();
     s.BtnControl(textBox2, "Stock",stock);
     Class.btnControl d = new Class.btnControl();
     d.BtnControl(textBox3, "Stock",stock);
 }
Exemplo n.º 21
0
        private void ProductionReqAdd_Load(object sender, EventArgs e)
        {
            dateTimePicker1.Value = Convert.ToDateTime(Class.DBConnString.clsDB.QueryExecuteScalarNonAlert("SELECT GETDATE()"));
            BtnBtnPrisonNameControlTxtPrisonName();
            BtnBtnProductNameControlTxtPrisonName();
            Class.btnControl btn = new Class.btnControl();
            btn.BtnControl(textBox6, "Shipper");

            //if (Lid != "" && Pid != "") {
            //    LoadDataPlus();
            //}
            //if (Lid == "" && Pid != "") {
            //    LoadData();
            //    textBox3.Enabled = false;
            //}
            if (Pid != "") {
                LoadData();
                textBox3.Enabled = false;
            }
            if (Class.clsCash.IsPermissionId("P11") == false)
            {
                button1.Enabled = false;
            }
            p = 1;
        }
Exemplo n.º 22
0
 private void TranferBrn_Load(object sender, EventArgs e)
 {
     Class.btnControl brn = new Class.btnControl();
     brn.BtnControl(textBox1, "Branch");
 }
        private void ProductionTransferMoney_Load(object sender, EventArgs e)
        {
            Class.btnControl btnemp = new Class.btnControl();
            btnemp.BtnControl(txtJ, "Employer");

            InitColumnsHead();
            InitColumnsItem();
            LoadDataFirst();
        }
Exemplo n.º 24
0
        void setFirstLoad()
        {
            tabControl1.TabPages.Remove(tabPage2);
            ///// DESTENATION
            string sqlDestination = "SELECT * FROM FINALDESTENATION";
            Class.Function.LoadDataCate(comboBox2, sqlDestination, "FinalDestenationId", "FinalDestenationName");
            string sqlLoading = "SELECT * FROM LOADING";
            Class.Function.LoadDataCate(comboBox7, sqlLoading, "LoadingId", "LoadingName");
            string sqlFeeder = "SELECT * FROM FEEDER";
            Class.Function.LoadDataCate(comboBox8, sqlFeeder, "FeederId", "FeederName");
            ///// สกุลเงิน
            string sqlCURRENCY = "SELECT SaleCurrencyId,SaleCurrencyName FROM CURRENCY WHERE SaleCurrencyId !='3'";
            Class.Function.LoadDataCate(comboBox5, sqlCURRENCY, "SaleCurrencyId", "SaleCurrencyName");
            Class.Function.LoadDataCate(comboBox4, sqlCURRENCY, "SaleCurrencyId", "SaleCurrencyName");
            ///// ภาษี
            string sqlTax = "select * from Tax where tax_auto_id not in(5,6)";
            Class.Function.LoadDataCate(comboBox3, sqlTax, "tax_auto_id", "tax_type");
            ///// ลูกค้า
            Class.btnControl btcus = new Class.btnControl();
            btcus.BtnControl(textBox13, "CustomerInv");
            ////// id
            //textBox1.Text = saleInvHeadId();
            Id = Class.Function.ReturnId("saleheadid", "sale_head").ToString();
            ////// accountid
            Class.btnControl bk = new btnControl();
            bk.BtnControl(textBox26, "TRCustomer2");
            ////// bank
            string sqlBank = "SELECT BankId,BankName FROM Bank";
            Class.Function.LoadDataCate(comboBox6, sqlBank, "BankId", "BankName");

            string sqlreason = "SELECT ReTypeId,ReTypeName FROM RE_REASON_TYPE";
            Class.Function.LoadDataCate(comboBox1, sqlreason, "ReTypeId", "ReTypeName");
        }
Exemplo n.º 25
0
 void firstLoad()
 {
     //setcolname
     toolStripButton1.Text = toolStripButton1.Text + " " + Class.DBConnString.sDb;
     //set list event
     Class.Function.LoadDataCate(comboBox1,
         "select 0 AS id,'ทั้งหมด' AS list "+
         "union all "+
         "SELECT ROW_NUMBER() over(order by list),list FROM dbo.StockInOut GROUP BY list",
         "id", "list");
     // set type customer or supplier
     Class.Function.LoadDataCate(comboBox2, "SELECT 1 as id,'ลูกค้า' as name UNION SELECT 2,'ผู้ขาย'","id","name");
     btnc.BtnControl(textBox4, "Customer");
     // main cate
     Class.Function.LoadDataCate(comboBox3, "select -1 as id,'ทั้งหมด' as name union all select maincateid,maincatename from maincate", "id", "name");
     Class.Function.LoadDataCate(comboBox4, "select -1 as id,'ทั้งหมด' as name", "id", "name");
     //set datepicker
     DataTable dt = Class.DBConnString.clsDB.QueryDataTable("SELECT min(stdate),max(stdate) FROM dbo.StockInOut");
     dateTimePicker1.Value = Convert.ToDateTime(dt.Rows[0][0]);
     dateTimePicker2.Value = Convert.ToDateTime(dt.Rows[0][1]);
     //set text find
     Class.btnControl btn = new Class.btnControl();
     btn.BtnControl(textBox5,"Shipper");
     Class.btnControl btnp = new Class.btnControl();
     btnp.BtnControl(textBox3, "Product");
     // call fist disabled
     FistDisabled();
 }
Exemplo n.º 26
0
        private void MetBack_Load(object sender, EventArgs e)
        {
            Class.btnControl btne = new Class.btnControl();
            btne.BtnControl(txtEmployer, "Employer");//กำหนดรูปแบบปุ่มการใช้งานเพื่อเรียกใช้ฟังก์ชัน designfunction ข้อมูลเรือนจำ

            Class.btnControl btEmployer = new Class.btnControl();
            btEmployer.BtnControl(txtEmployer2, "Employer");//เรียกใช้ฟังก์ชัน designfunction
            Class.btnControl btShip = new Class.btnControl();
            btShip.BtnControl(txtShip, "Shipper");//เรียกใช้ฟังก์ชัน designfunction

            Class.btnControl btnProduct = new Class.btnControl();
            btnProduct.BtnControl(txtProduct, "Product");
        }
Exemplo n.º 27
0
 private void loadFirst()
 {
     /*ดึงหน้า form เริ่มต้นการใช้งาน*/
     textBox1.Text = loadId();
     Class.btnControl btnE = new Class.btnControl();
     btnE.BtnControl(textBox3, "Employer");//เรียกใช้ฟังก์ชัน Designfunction ข้อมูลเรือนจำ
     Class.btnControl btnS = new Class.btnControl();
     btnS.BtnControl(textBox6, "Shipper");//เรียกใช้ฟังก์ชัน Designfunction ข้อมูลขนส่ง
     dataGridView2.ColumnCount = 15;/*กำหนด column name และ headertext ของ datagridview */
     dataGridView2.Columns[0].Name = "Id";
     dataGridView2.Columns[0].HeaderText = "รหัสพาเลต";
     dataGridView2.Columns[1].Name = "FmId";
     dataGridView2.Columns[1].HeaderText = "รหัสสูตร";
     dataGridView2.Columns[2].Name = "FmName";
     dataGridView2.Columns[2].HeaderText = "ชื่อสูตร";
     dataGridView2.Columns[2].Width = 200;
     dataGridView2.Columns[3].Name = "Pallet";
     dataGridView2.Columns[3].HeaderText = "พาเลท";
     dataGridView2.Columns[4].Name = "Quantity";
     dataGridView2.Columns[4].HeaderText = "จำนวน";
     dataGridView2.Columns[5].Name = "Unit";
     dataGridView2.Columns[5].HeaderText = "หน่วย";
     dataGridView2.Columns[6].Name = "PwId";
     dataGridView2.Columns[6].HeaderText = "รหัสค่าจ้าง";
     dataGridView2.Columns[7].Name = "PwN7";
     dataGridView2.Columns[7].HeaderText = "หมายเลข7/น";
     dataGridView2.Columns[8].Name = "PwOutSide";
     dataGridView2.Columns[8].HeaderText = "ค่าจ้างนอก/น";
     dataGridView2.Columns[9].Name = "PwPB";
     dataGridView2.Columns[9].HeaderText = "ผบ/น";
     dataGridView2.Columns[10].Name = "PwShip";
     dataGridView2.Columns[10].HeaderText = "ขนส่ง/น";
     dataGridView2.Columns[11].Name = "PwOther";
     dataGridView2.Columns[11].HeaderText = "อื่นๆ/น";
     dataGridView2.Columns[12].Name = "Total";
     dataGridView2.Columns[12].HeaderText = "รวมทั้งสิ้น";
     dataGridView2.Columns[13].Name = "Remark";
     dataGridView2.Columns[13].HeaderText = "หมายเหตุ";
     dataGridView2.Columns[14].Name = "cate";
     dataGridView2.Columns[14].HeaderText = "ประเภท";
 }
Exemplo n.º 28
0
        private void ProductionReqAdd_Load(object sender, EventArgs e)
        {
            var c = System.Threading.Thread.CurrentThread.CurrentCulture;
            dateTimePicker1.Value = Convert.ToDateTime(Class.DBConnString.clsDB.QueryExecuteScalarNonAlert("SELECT GETDATE()"));

            tableLayoutPanel5.Enabled = true;
            BtnBtnPrisonNameControlTxtPrisonName();
            BtnBtnProductNameControlTxtPrisonName();
            Class.btnControl btn = new Class.btnControl();
            btn.BtnControl(textBox6, "Shipper");//เรียกใช้ฟังก์ชัน เลือกเรือนจำ

            SetEdit();

            //if (Lid != "" && Pid != "") {
            //    LoadDataPlus();
            //}
            //if (Lid == "" && Pid != "") {
            //    LoadData();
            //    textBox3.Enabled = false;
            //}
            if (Pid != "") {
                LoadData();
                textBox3.Enabled = false;
            }
            if (Class.clsCash.IsPermissionId("P11") == false)
            {
                button1.Enabled = false;
            }
            p = 1;
        }
Exemplo n.º 29
0
        private void MainSalePos_Load(object sender, EventArgs e)
        {
            Class.btnControl btcus = new Class.btnControl();//กำหนดปุ่มการทำงาน
            btcus.BtnControl(textBox5, "Customer");
            //end
            Class.btnControl btpd = new Class.btnControl();//กำหนดปุ่มการทำงาน
            btpd.BtnControl(textBox4, "Product");
            //end
            Class.Function.LoadDataCate(comboBox1,
                "select 0 as saleheadstatusid,'ทั้งหมด' as saleheadstatusname union all select * from SALEHEADSTATUS where saleheadstatusid not in(3) ",
                "saleheadstatusid", "saleheadstatusname");//สถานะใบขายเพื่อการค้นหา
            comboBox2.Items.Add(new ComboboxItem { Text = "ทั้งหมด", Value = 0 });
            comboBox2.Items.Add(new ComboboxItem { Text = "1000", Value = 1000 });
            comboBox2.Items.Add(new ComboboxItem { Text = "500", Value = 500 });
            comboBox2.Items.Add(new ComboboxItem { Text = "100", Value = 100 });
            comboBox2.SelectedIndex = 0;
            //การกำหนดสิทธิ์เข้าใช้งานโปรแกรม ให้ใช้ได้เฉพาะฐานข้อมูล
            if (Class.DBConnString.sDb != "KTC")
            {
                ตางประเทศToolStripMenuItem.Visible = false;
                toolStripButton6.Visible = false;
                toolStripButton9.Visible = false;

                iNVOICESAHADEEToolStripMenuItem.Visible = false;
                iNVOICEORIGINALToolStripMenuItem.Visible = false;
                pACKINGLISTORIGINALToolStripMenuItem.Visible = false;
                pACKINGREPORTToolStripMenuItem.Visible = false;
            }
            //end
            //กำหนดสิทธิ์ในการเข้าใช้งานของพนักงาน
            if (clsCash.IsPermissionId("P31") == false)
            {
                toolStripButton2.Enabled = false;
                toolStripButton3.Enabled = false;
            }
            else
            {
                toolStripButton2.Enabled = true;
                toolStripButton3.Enabled = true;
            }
            //end
        }
Exemplo n.º 30
0
 /*กำหนด form เริ่มต้น*/
 void setFirstLoad()
 {
     ///// รหัสเบิก
     //string sqlDRAW = "SELECT DrawId,DrawName FROM DRAW";
     //Class.Function.LoadDataCate(comboBox1, sqlDRAW, "DrawId", "DrawName");
     //if (Class.DBConnString.sDb == "7CSK") { comboBox1.SelectedIndex = 11; }
     //else if (Class.DBConnString.sDb == "SHOP") { comboBox1.SelectedIndex = 7; }
     //else if (Class.DBConnString.sDb == "KTC") { comboBox1.SelectedIndex = 2; }
     //else { comboBox1.SelectedIndex = 11; }
     ///// ประเภทการขาย
     //string sqlSaleType = "SELECT SaleHeadSaleTypeId,SaleHeadSaleTypeName FROM SALEHEADSALETYPE";
     //Class.Function.LoadDataCate(comboBox2, sqlSaleType, "SaleHeadSaleTypeId", "SaleHeadSaleTypeName");
     ///// สกุลเงิน
     //string sqlCURRENCY = "SELECT SaleCurrencyId,SaleCurrencyName FROM CURRENCY";
     //Class.Function.LoadDataCate(comboBox5, sqlCURRENCY, "SaleCurrencyId", "SaleCurrencyName");
     //Class.Function.LoadDataCate(comboBox4, sqlCURRENCY, "SaleCurrencyId", "SaleCurrencyName");
     ///// ภาษี
     string sqlTax = "select * from Tax where tax_auto_id not in(5,6)";
     Class.Function.LoadDataCate(comboBox3, sqlTax, "tax_auto_id", "tax_type");
     ///// ลูกค้า
     Class.btnControl btcus = new Class.btnControl();
     btcus.BtnControl(textBox13, "Customer");
     ////// accountid
     Class.btnControl bk = new btnControl();
     bk.BtnControl(textBox26, "TRCustomer2");
     ////// bank
     string sqlBank = "SELECT BankId,BankName FROM Bank";
     Class.Function.LoadDataCate(comboBox6, sqlBank, "BankId", "BankName");
 }