Ejemplo n.º 1
0
 /*กำหนดปุ่มการทำงานเพื่อเรียกใช้ฟังก์ชัน designfunction*/
 private void Call_Func()
 {
     btnControl btnShip = new btnControl();
     btnShip.BtnControl(txtCustomer, "Customer");
     btnControl btnStock = new btnControl();
     btnStock.BtnControl(txtStock, "ACustomer");
     txtStock.Text = "[1] เอเซียคริ๊งส์";
 }
Ejemplo n.º 2
0
        public ShippingRates()
        {
            InitializeComponent();
            showDgvRate();
            addItemCombobox();

            btnControl btnSP = new btnControl();
            btnSP.BtnControl(txtShipper, "Shipper");
        }
Ejemplo n.º 3
0
        public ShippingProduct()
        {
            InitializeComponent();
            AddCombobox();
            showDgvShipProduct();

            btnControl btn = new btnControl();
            btn.BtnControl(tbxProduct, "Product");
        }
Ejemplo n.º 4
0
 private void Call_Func()
 {
     btnControl btnProduct1 = new btnControl();
     btnProduct1.BtnControl(txtProduct1, "ProductCallToReport");
     btnControl btnProduct2 = new btnControl();
     btnProduct2.BtnControl(txtProduct2, "ProductCallToReport");
     btnControl btnShip = new btnControl();
     btnShip.BtnControl(txtStock, "ACustomer");
     txtStock.Text = "[1] เอเซียคริ๊งส์";
 }
Ejemplo n.º 5
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");
        }
Ejemplo n.º 6
0
 private void Call_Customer()
 {
     btnControl btnSup = new btnControl();
     btnSup.BtnControl(tbCustomer, "Customer");
 }
Ejemplo n.º 7
0
 private void Call_Func()
 {
     btnControl btnCup = new btnControl();
     btnCup.BtnControl(txtSupplier, "Customer");
     btnControl btnShip = new btnControl();
     btnShip.BtnControl(txtShipper, "AShipper");
     btnControl btnStock = new btnControl();
     btnStock.BtnControl(txtStock, "ACustomer");
 }
Ejemplo n.º 8
0
 private void ShippingCreate_Load(object sender, EventArgs e)
 {
     btnBillSaleControltxtBillSale();
     btnControl btnSP = new btnControl();
     btnSP.BtnControl(txtShipper, "Shipper");
     txtUserName.Text = clsCash.sUserLogin;
     FormatDgvSale();
     FormatDgvDetail();
     if (shippingIdforEdit != "")
     {
         editShipping(shippingIdforEdit);
     }
 }
Ejemplo n.º 9
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");
 }
Ejemplo n.º 10
0
        private void frmSalePos7CSK_Load(object sender, EventArgs e)
        {
            if (!DBConnString.clsDB.IsConnected()) return;
            string strConn;
            strConn = DBConnString.strConn;
            Conn = new SqlConnection();
            if (Conn.State == ConnectionState.Open)
            {
                Conn.Close();
            }
            Conn.ConnectionString = strConn;
            Conn.Open();

            userId = clsCash.sUserIdLogin;
            lblNameBranch.Text = DBConnString.sCatalog;
            DateAbout();
            cboDraw();
            cboSaleType();
            //  cbo จำนวนสแดงต่อหน้าของ pnlProductlist
            cboPageSize.Items.Add("10");
            cboPageSize.Items.Add("25");
            cboPageSize.Items.Add("50");
            cboPageSize.Items.Add("100");
            cboPageSize.SelectedIndex = 3;

            txtPage.Text = "1";
            OldPageSize = Convert.ToInt32(cboPageSize.Text);
            PageSize = Convert.ToInt32(cboPageSize.Text);

            cboPrice.Items.Add("10");
            cboPrice.Items.Add("25");
            cboPrice.Items.Add("50");
            cboPrice.Items.Add("100");
            cboPrice.SelectedIndex = 3;

            txtPrice.Text = "1";
            OldPageSize = Convert.ToInt32(cboPrice.Text);
            PageSizePrice = Convert.ToInt32(cboPrice.Text);

            txtVATRate.Text = "0";
            showlsvProduct();
            //

            txtCustomer.Text = "";
            this.Text = "หน้าจอขาย  : [" + CustomerId + "] " + cusname + " ยังไม่บันทึกในฐานข้อมูล ";
            cboStatus.Text = "ปกติ";

            //  ++++ ชุด แสดง auto complete
            string sqlProducts;
            sqlProducts = "SELECT * FROM Customer WHERE CustomerActiveStatus = 0 ORDER BY CustomerName ";
            com = new SqlCommand();

            this.Cursor = Cursors.WaitCursor;
            com.CommandText = sqlProducts;
            com.CommandType = CommandType.Text;
            com.Connection = Conn;
            dr = com.ExecuteReader();
            if (dr.HasRows)
            {
                dt = new DataTable();
                dt.Load(dr);
                dr.Close();
                foreach (DataRow drw in dt.Rows)
                {
                    //acCustomer.Add(drw["CustomerName"].ToString());
                }
            }
            else
            {
                dr.Close();
            }
            this.Cursor = Cursors.Default;
            txtSearch.Focus();
            SetAutoCompleteMode();

            if (DBConnString.sCode == "7CSK")
            {
                BackColor = Color.PaleTurquoise;
            }
            if (DBConnString.sCode == "SHOP")
            {
                BackColor = Color.Bisque;
            }
            if (DBConnString.sCode == "KTC")
            {
                BackColor = Color.PaleGreen;
            }
            //btnEditWeight.Enabled = false;

            if (txtSaleAppHeadId.Text.Trim() != "")
            {
                //txtSaleAppHeadId.Enabled = false;
                //btnLoadDataAppSale.Enabled = false;
                string SaleAppHeadId = txtSaleAppHeadId.Text.Trim();//รับค่ารหัสใบเบิก
                DataTable dtHead = GetDataHead();
                if (SaleAppHeadId == "" || dtHead.Rows.Count == 0)
                {
                    MessageBox.Show("กรุณากรอกรหัสการเบิกให้ถูกต้อง", "ข้อผิดพลาด", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                String CustomerName = "[" + dtHead.Rows[0][3].ToString() + "] " + dtHead.Rows[0][0].ToString();

                //String IsSend = dtHead.Rows[0][1].ToString();
                String SaleHeadId = dtHead.Rows[0][2].ToString();

                //if (IsSend == "0")
                //{
                //    MessageBox.Show("การเบิกยังไม่ได้รับการตรวจ", "ข้อผิดพลาด", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //    return;
                //}

                //if (SaleHeadId != "")
                //{
                //    MessageBox.Show("รายการนี้ทำการขายแล้ว รหัสขาย ---> " + SaleHeadId, "ข้อผิดพลาด", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //    return;
                //}

                if (CustomerName == null) return;

                txtCustomer.Text = CustomerName;
                setcboDrawId();
                txtDrawId.Text = dtHead.Rows[0][4].ToString();
                ShowLv();
                return;

            }
            txtSaleAppHeadId.Focus();

            btnControl btnSup = new btnControl();
            btnSup.BtnControl(txtCustomer, "Customer");
        }
Ejemplo n.º 11
0
        private void retuenNulltext(bool t)
        {
            btnControl btnSup = new btnControl();
            btnSup.BtnControl(txtSupplier, "ACustomer");
            //btnControl btnSid = new btnControl();
            //btnSid.BtnControl(txtRequis, "ASid");
            btnControl btnShip = new btnControl();
            btnShip.BtnControl(txtShipper, "AShipper");
            //btnControl btnEmp = new btnControl();
            //btnEmp.BtnControl(txtEmployer, "Employer");
            BtnProductNameControlTxtProductName();
            getTypeCO();
            //cboReceiveType.BeginUpdate();
            //String sqlRT = "SELECT * FROM COSIGNMENT_STOCK_TYPE where COTypeId='0'";
            //cboReceiveType.DataSource = Class.DBConnString.clsDB.QueryDataTable(sqlRT);
            //cboReceiveType.DisplayMember = "COTypeName";
            //cboReceiveType.ValueMember = "COTypeId";
            //cboReceiveType.EndUpdate();
            //txtSupplier.Text = "[1821] สินค้าฝากเอเซียดริ้งส์";
            TxtDescription.Text = "";
            TxtPriceTotal.Text = "0.00";
            TxtDiscount.Text = "0.00";
            TxtDiscountText.Text = "";
            TxtBaseVat.Text = "0.00";
            TxtVat.Text = "0.00";
            //CmboxVat.SelectedIndex = 0;
            TxtPercentVat.Text = "0";
            TxtAmountTotal.Text = "0.00";

            dptRecDate.Value = DateTime.Now;
            //textBox1.Text = "";
            txtShipper.Text = "";
            //txtEmployer.Text = "";
            dgvReceive.DataSource = null;
            dgvWeight.DataSource = null;
            txtSupplier.Focus();
            if (t == false)
            {
                txtRec.Enabled = false;
                string  nextCOHeadId_run = Function.GetCOHeadId();
                txtRec.Text = nextCOHeadId_run;
            }
            else
            {
                txtRec.Text = "";
                txtRec.Enabled = true;
                txtRec.Focus();
            }
        }
Ejemplo n.º 12
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");
        }
Ejemplo n.º 13
0
 private void setBtn()
 {
     btnControl btnCus = new btnControl();
     btnCus.BtnControl(txtCus, "Customer");
     btnControl btnCus2 = new btnControl();
     btnCus2.BtnControl(txtCus2, "Customer");
     btnControl btnPro = new btnControl();
     btnPro.BtnControl(txtPro, "Product");
     btnControl btnPro2 = new btnControl();
     btnPro2.BtnControl(txtPro2, "Product");
 }
Ejemplo n.º 14
0
        //เรียกหน้าใหม่ set ค่าว่างใน form
        void setFirstLoad()
        {
            tabControl1.TabPages.Remove(tabPage2);
            ///// สกุลเงิน
            //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");
            ///// ลูกค้า
            if (Class.DBConnString.sDb != "KTC")
            {
                Class.btnControl btcus = new Class.btnControl();
                btcus.BtnControl(textBox13, "Customer");
            }
            else
            {
                Class.btnControl btcus = new Class.btnControl();
                btcus.BtnControl(textBox13, "CustomerTHA");
            }
            ////// id
            textBox1.Text = SaleFunction.saleSOid(dateTimePicker1.Value);
            Id = Class.Function.ReturnId("saleheadid", "sale_head").ToString();
            ////// accountid
            Class.btnControl bk = new btnControl();
            bk.BtnControl(textBox26, "TRCustomer2");
            ////// bank
            Class.btnControl btShipp = new Class.btnControl();
            btShipp.BtnControl(textBox3, "AShipper");

            ////// deposit
            //Class.btnControl deposit = new btnControl();
            //deposit.BtnControl(textBox10, "DialogDeposit",Class.Function.GetTextId(textBox13.Text));

            string sqlBank = "SELECT BankId,BankName FROM Bank";
            Class.Function.LoadDataCate(comboBox6, sqlBank, "BankId", "BankName");
        }
Ejemplo n.º 15
0
        private void frmReceiveAsiaDrink_Load(object sender, EventArgs e)
        {
            dptRecDate.Value = Class.DBConnString.toDay;
            dptBillSupplier.Value = Class.DBConnString.toDay;

            string strConn;
            strConn = DBConnString.strConn;
            Conn = new SqlConnection();
            if (Conn.State == ConnectionState.Open)
            {
                Conn.Close();
            }
            Conn.ConnectionString = strConn;
            Conn.Open();
            userId = clsCash.sUserIdLogin;
            //  cbo จำนวนสแดงต่อหน้าของ pnlProductlist
            cboPageSize.Items.Add("10");
            cboPageSize.Items.Add("25");
            cboPageSize.Items.Add("50");
            cboPageSize.Items.Add("100");
            cboPageSize.SelectedIndex = 3;

            txtPage.Text = "1";
            OldPageSize = Convert.ToInt32(cboPageSize.Text);
            PageSize = Convert.ToInt32(cboPageSize.Text);

            showlsvProduct();

            MaxIdInternal();
            if (status == 1)
            {

                EditDataHead();
                EditDataDetail();
                //cmdAdd.Text = "แก้ไข";

            }
            txtSupplier.Text = "ไม่ระบุ";
            this.Text = "หน้าจอรับของฝาก  : [" + intSupplierId + "] " + SupplierName + " ยังไม่บันทึกในฐานข้อมูล ";

            //  ++++ ชุด แสดง auto complete
            string sqlProducts;
            sqlProducts = "SELECT * FROM SUPPLIER";
            com = new SqlCommand();

            this.Cursor = Cursors.WaitCursor;
            com.CommandText = sqlProducts;
            com.CommandType = CommandType.Text;
            com.Connection = Conn;
            dr = com.ExecuteReader();
            if (dr.HasRows)
            {
                dt = new DataTable();
                dt.Load(dr);
                dr.Close();
                foreach (DataRow drw in dt.Rows)
                {
                    acSupplier.Add(drw["SupplierName"].ToString());
                }
            }
            else
            {
                dr.Close();
            }
            this.Cursor = Cursors.Default;
            txtSearch.Focus();
            SetAutoCompleteMode();

            //btnEditWeight.Enabled = false;
            btnControl btnShip = new btnControl();
            btnShip.BtnControl(txtShipId, "Shipper");//กำหนดปุ่มการทำงานเพื่อเรียกใช้ฟังก์ชัน designfunction
        }
Ejemplo n.º 16
0
 private void Call_Func()
 {
     btnControl btnShip = new btnControl();
     btnShip.BtnControl(txtShipper, "AShipper");
 }
Ejemplo n.º 17
0
 private void retuenNulltext()
 {
     btnControl btnCus = new btnControl();
     btnCus.BtnControl(txtCustomer, "ACustomer");
     btnControl btnShi = new btnControl();
     btnShi.BtnControl(txtShip, "AShipper");
 }
Ejemplo n.º 18
0
 private void Call_Product()
 {
     btnControl btnSup = new btnControl();
     btnSup.BtnControl(tbProduct, "Product");
 }
Ejemplo n.º 19
0
        /*กำหนด form ใช้งานเริ่มต้น*/
        private void retuenNulltext(bool t)
        {
            btnControl btnSup = new btnControl();
            btnSup.BtnControl(txtSupplier, "Supplier");//กำหนดปุ่มการทำงานเพื่อเรียกใช้ฟังก์ชัน designfunction
            btnControl btnShip = new btnControl();
            btnShip.BtnControl(txtShipper, "Shipper");//กำหนดปุ่มการทำงานเพื่อเรียกใช้ฟังก์ชัน designfunction
            btnControl btnEmp = new btnControl();
            btnEmp.BtnControl(txtEmployer, "Employer");//กำหนดปุ่มการทำงานเพื่อเรียกใช้ฟังก์ชัน designfunction
            btnControl btnBrn = new btnControl();
            btnBrn.BtnControl(textBox2, "BranchReceive");//กำหนดปุ่มการทำงานเพื่อเรียกใช้ฟังก์ชัน designfunction
            BtnProductNameControlTxtProductName();
            cboReceiveType.BeginUpdate();
            String sqlRT = "SELECT * FROM RECEIVE_TYPE ORDER BY ReceiveTypeId";// ดึงประเภทการรับแสดงใน combobox
            cboReceiveType.DataSource = Class.DBConnString.clsDB.QueryDataTable(sqlRT);
            cboReceiveType.DisplayMember = "ReceiveTypeName";
            cboReceiveType.ValueMember = "ReceiveTypeId";
            cboReceiveType.EndUpdate();
            cboDrawId.BeginUpdate();
            String sqlLP = "SELECT LocationProductId,LocationProductName FROM LOCATION_PRODUCT";// ดึงประเภทการจัดสินค้า combobox
            cboDrawId.DataSource = Class.DBConnString.clsDB.QueryDataTable(sqlLP);
            cboDrawId.DisplayMember = "LocationProductName";
            cboDrawId.ValueMember = "LocationProductId";
            cboDrawId.EndUpdate();
            txtSupplier.Text = "";
            dptDateBillSupplier.Value = DateTime.Now;
            dptDateBillShipping.Value = DateTime.Now;
            /*ล้างข้อมูลใน form*/
            txtDrawId.Text = "";
            txtInvoice.Text = "";
            txtShipping.Text = "";
            TxtDescription.Text = "";
            TxtPriceTotal.Text = "0.00";
            TxtDiscount.Text = "0.00";
            TxtDiscountText.Text = "0.00";
            TxtBaseVat.Text = "0.00";
            TxtVat.Text = "0.00";
            CmboxVat.SelectedIndex = 0;
            TxtPercentVat.Text = "0";
            TxtAmountTotal.Text = "0.00";

            dptRecDate.Value = DateTime.Now;
            textBox1.Text = "";
            txtShipper.Text = "";
            txtEmployer.Text = "";
            dgvReceive.Rows.Clear();
            dgvWeight.Rows.Clear();
            CmboxVat.SelectedIndex = 0;
            txtSupplier.Focus();
            if (t == false)
            {
                txtRec.Enabled = false;
                int ReceiveHeadId = Function.GetReceiveHeadId();
                txtRec.Text = ReceiveHeadId.ToString();
            }
            else
            {
                txtRec.Text = "";
                txtRec.Enabled = true;
                txtRec.Focus();
            }
            if (Class.DBConnString.sDb == "KTC")
            {
                textBox2.Text = "[1] บริษัท เค ที ซี เน็ตติ้ง จำกัด";
            }
        }
Ejemplo n.º 20
0
        private void retuenNulltext(bool t)
        {
            /*กำหนดหน้า form ใหม่*/
            btnControl btnSup = new btnControl();
            btnSup.BtnControl(txtSupplier, "Supplier");
            //btnControl btnShip = new btnControl();
            //btnShip.BtnControl(txtShipper, "Shipper");
            //btnControl btnEmp = new btnControl();
            //btnEmp.BtnControl(txtEmployer, "Employer");
            BtnProductNameControlTxtProductName();
            //cboReceiveType.BeginUpdate();
            //String sqlRT = "SELECT * FROM RECEIVE_TYPE ORDER BY ReceiveTypeId";
            //cboReceiveType.DataSource = Class.DBConnString.clsDB.QueryDataTable(sqlRT);
            //cboReceiveType.DisplayMember = "ReceiveTypeName";
            //cboReceiveType.ValueMember = "ReceiveTypeId";
            //cboReceiveType.EndUpdate();
            //cboDrawId.BeginUpdate();
            //String sqlLP = "SELECT LocationProductId,LocationProductName FROM LOCATION_PRODUCT";
            //cboDrawId.DataSource = Class.DBConnString.clsDB.QueryDataTable(sqlLP);
            //cboDrawId.DisplayMember = "LocationProductName";
            //cboDrawId.ValueMember = "LocationProductId";
            //cboDrawId.EndUpdate();
            txtSupplier.Text = "";
            dptDateBillSupplier.Value = DateTime.Now;
            //dptDateBillShipping.Value = DateTime.Now;

            //txtDrawId.Text = "";
            txtInvoice.Text = "";
            //txtShipping.Text = "";
            TxtDescription.Text = "";
            TxtPriceTotal.Text = "0.00";
            TxtDiscount.Text = "0.00";
            TxtDiscountText.Text = "0.00";
            TxtBaseVat.Text = "0.00";
            TxtVat.Text = "0.00";
            CmboxVat.SelectedIndex = 0;
            TxtPercentVat.Text = "0";
            TxtAmountTotal.Text = "0.00";

            dptRecDate.Value = DateTime.Now;
            textBox1.Text = "";
            //txtShipper.Text = "";
            //txtEmployer.Text = "";
            dgvReceive.Rows.Clear();
            dgvWeight.Rows.Clear();
            CmboxVat.SelectedIndex = 0;
            txtSupplier.Focus();
            if (t == false)
            {
                txtRec.Enabled = false;
                int OutsideStockHeadId = Function.GetOutsideStockHeadId();
                txtRec.Text = OutsideStockHeadId.ToString();
            }
            else
            {
                txtRec.Text = "";
                txtRec.Enabled = true;
                txtRec.Focus();
            }
        }
Ejemplo n.º 21
0
 private void frmselectreport_Load(object sender, EventArgs e)
 {
     btnControl btnShip = new btnControl();
     btnShip.BtnControl(txtship, "Shipper");
 }
Ejemplo n.º 22
0
        private void frmEditSaleBack_Load(object sender, EventArgs e)
        {
            string strConn;
            strConn = DBConnString.strConn;
            Conn = new SqlConnection();
            if (Conn.State == ConnectionState.Open)
            {
                Conn.Close();
            }
            Conn.ConnectionString = strConn;
            Conn.Open();
            showlsvProduct();

            cboPageSize_Sup.Items.Add("10");
            cboPageSize_Sup.Items.Add("25");
            cboPageSize_Sup.Items.Add("50");
            cboPageSize_Sup.Items.Add("100");
            cboPageSize_Sup.SelectedIndex = 3;

            cboSearchSaleBack.Items.Add("ชื่อสินค้า");
            cboSearchSaleBack.Items.Add("ชื่อผู้ขาย");
            cboSearchSaleBack.Items.Add("เลขที่การรับ");
            cboSearchSaleBack.Items.Add("รหัสสินค้า");
            cboSearchSaleBack.SelectedIndex = 0;

            txtPage_Sup.Text = "1";
            OldPageSize = Convert.ToInt32(cboPageSize_Sup.Text);
            PageSize = Convert.ToInt32(cboPageSize_Sup.Text);

            cboPageSize.Items.Add("10");
            cboPageSize.Items.Add("25");
            cboPageSize.Items.Add("50");
            cboPageSize.Items.Add("100");
            cboPageSize.SelectedIndex = 3;

            txtPage.Text = "1";
            OldPageSize2 = Convert.ToInt32(cboPageSize.Text);
            PageSize2 = Convert.ToInt32(cboPageSize.Text);
            OldPageSize3 = Convert.ToInt32(cboPageSize.Text);
            PageSize3 = Convert.ToInt32(cboPageSize.Text);

            ArraySelectDetail();
            EditData();
            CalculateNet();
            txtVATRate.Text = "0";

            btnControl btnSup = new btnControl();
            btnSup.BtnControl(txtSupplier, "Supplier");
            btnControl btnShip = new btnControl();
            btnShip.BtnControl(txtShipper, "Shipper");
            //btnControl btnShip = new btnControl();
            //btnShip.BtnControl(txtShipper, "Shipper");
            //  ++++ ชุด แสดง auto complete
            /*string sqlProducts;

            sqlProducts = "SELECT * FROM SUPPLIER ORDER BY SupplierName";
            com = new SqlCommand();

            this.Cursor = Cursors.WaitCursor;
            com.CommandText = sqlProducts;
            com.CommandType = CommandType.Text;
            com.Connection = Conn;
            dr = com.ExecuteReader();
            if (dr.HasRows)
            {
                dt = new DataTable();
                dt.Load(dr);
                dr.Close();
                foreach (DataRow drw in dt.Rows)
                {
                    acCustomer.Add(drw["SupplierName"].ToString());
                }
            }
            else
            {
                dr.Close();
            }
            this.Cursor = Cursors.Default;
            SetAutoCompleteMode();
            */
            // จบ
        }
Ejemplo n.º 23
0
 private void setBtn()
 {
     //btnControl btnSup = new btnControl();
     //btnSup.BtnControl(txtSup, "Supplier");
     //btnControl btnBrn = new btnControl();
     //btnBrn.BtnControl(txtBrn, "Branch");
     btnControl btnPro = new btnControl();
     btnPro.BtnControl(txtPro, "Product");
     //btnControl btnSup2 = new btnControl();
     //btnSup2.BtnControl(txtSup2, "Supplier");
     //btnControl btnBrn2 = new btnControl();
     //btnBrn2.BtnControl(txtBrn2, "Branch");
     btnControl btnPro2 = new btnControl();
     btnPro2.BtnControl(txtPro2, "Product");
 }
Ejemplo n.º 24
0
 private void Call_Func()
 {
     btnControl btnCup = new btnControl();
     btnCup.BtnControl(txtBra, "TRCustomer");
 }
Ejemplo n.º 25
0
 /*กำหนดปุ่มการทำงานเรียกใช้ฟังก์ชัน*/
 private void Call_Func()
 {
     btnControl btnStock = new btnControl();
     btnStock.BtnControl(textBox11, "DialogSaleVat");
 }
Ejemplo n.º 26
0
        private void MainShipping_Load(object sender, EventArgs e)
        {
            btnControl btnShipper = new btnControl();
            btnShipper.BtnControl(txtShipper, "Shipper");

            btnControl btnCustomer = new btnControl();
            btnCustomer.BtnControl(txtCustomer, "Customer");

            setBtnShipperId();

            if (clsCash.IsPermissionId("P43") == false)
            {
                btnApprove.Enabled = false;
                btnWaiting.Enabled = false;

            }
            else
            {
                btnApprove.Enabled = true;
                btnWaiting.Enabled = true;
            }
        }
Ejemplo n.º 27
0
        void setFirstLoad()
        {
            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, "CustomerTHA");

            textBox1.Text = saleSOid();
            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");
        }
Ejemplo n.º 28
0
 /*กำหนดรูปแบบของปุ่มเพื่อเรียกใช้ฟังก์ชัน*/
 private void setBtn()
 {
     btnControl btnSup = new btnControl();
     btnSup.BtnControl(txtSup, "Stock");
     btnControl btnBrn = new btnControl();
     btnBrn.BtnControl(txtBrn, "Stock");
     btnControl btnPro = new btnControl();
     btnPro.BtnControl(txtPro, "Product");
     btnControl btnSup2 = new btnControl();
     btnSup2.BtnControl(txtSup2, "Stock");
     btnControl btnBrn2 = new btnControl();
     btnBrn2.BtnControl(txtBrn2, "Stock");
     btnControl btnPro2 = new btnControl();
     btnPro2.BtnControl(txtPro2, "Product");
 }
Ejemplo n.º 29
0
 /*กำหนดรูปแบบของปุ่มการทำงานเพื่อเรียกใช้ฟังก์ชัน designfunction*/
 private void setBtn()
 {
     btnControl btnSup = new btnControl();
     if(PC)
         btnSup.BtnControl(txtSup, "Supplier");
     else
         btnSup.BtnControl(txtSup, "Customer");
     btnControl btnBrn = new btnControl();
     btnBrn.BtnControl(txtBrn, "Branch");
     btnControl btnPro = new btnControl();
     btnPro.BtnControl(txtPro, "Product");
     btnControl btnSup2 = new btnControl();
     if (PC)
         btnSup2.BtnControl(txtSup2, "Supplier");
     else
         btnSup2.BtnControl(txtSup2, "Customer");
     btnControl btnBrn2 = new btnControl();
     btnBrn2.BtnControl(txtBrn2, "Branch");
     btnControl btnPro2 = new btnControl();
     btnPro2.BtnControl(txtPro2, "Product");
 }
Ejemplo n.º 30
0
 /*กำหนดรูปแบบของปุ่มการทำงานเพื่อเรียกใช้ฟังก์ชัน designfunction*/
 private void Call_Func()
 {
     btnControl btnCus = new btnControl();
     btnCus.BtnControl(txtStock, "ACustomer");
     Class.btnControl btcust = new Class.btnControl();
     btcust.BtnControl(textBox1, "Customer");
 }