Ejemplo n.º 1
0
        private void txtBarcode_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (txtBarcode.Text != "")
                {
                    if (txtBarcode.Text.Length >= 10)
                    {
                        pro.sqlselect = "SELECT OrderId,Supplier,OrderDate,p.Barcode,ProductName,Description,Category,p.OriginalPrice,OrderQty,Unit,OrderTotal " +
                                        " FROM tblcategory c, tblproduct p,tblorder o , tblsupplier s " +
                                        " WHERE p.CategoryId=c.CategoryId AND p.Barcode=o.Barcode AND o.SupplierId=s.SupplierId AND Rem='Ordered' And p.Barcode = '" + txtBarcode.Text + "'";
                        pro.LoadData(pro.sqlselect, dtgOrderlist);
                        dtgOrderlist.Columns[0].Visible = false;

                        //pro.sqlselect = "SELECT * FROM tblcategory c, tblproduct p  WHERE p.CategoryId=c.CategoryId And Barcode Like '%" + txtBarcode.Text + "%'";
                        //pro.Single_Select(pro.sqlselect);

                        //if (pro.dt.Rows.Count > 0)
                        //{
                        //    decimal price;
                        //    txtProduct.Text = pro.dt.Rows[0].Field<string>("ProductName");
                        //    txtDescription.Text = pro.dt.Rows[0].Field<string>("Description");
                        //    txtCategory.Text = pro.dt.Rows[0].Field<string>("Category");
                        //    price = pro.dt.Rows[0].Field<decimal>("OriginalPrice");
                        //    txtPrice.Text = price.ToString("N2");
                        //}
                        //else
                        //{
                        //    clearStockin();
                        //}
                    }
                    else
                    {
                        txtProduct.Clear();
                        txtDescription.Clear();
                        txtPrice.Clear();
                        txtCategory.Clear();
                        txtQty.Clear();
                    }
                }
                else
                {
                    txtProduct.Clear();
                    txtDescription.Clear();
                    txtPrice.Clear();
                    txtCategory.Clear();
                    txtQty.Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void frmCategory_Load(object sender, EventArgs e)
        {
            config.sqlselect = "SELECT c.CategoryId,Category,CategoryType,Unit FROM tblcategory c,tblautonumber a WHERE c.CategoryId=a.CategoryId";
            config.LoadData(config.sqlselect, dtglist);
            txtcategory.Clear();
            txtUnit.Clear();
            txtType.Clear();
            categoryid = 0;
            dtglist.Columns[0].Visible = false;

            config.FillAutonumber(4, lblCategoryId);
        }
Ejemplo n.º 3
0
        private void frmProduct_Load(object sender, EventArgs e)
        {
            try
            {
                txtBarcode.MaxLength = 11;
                //pro.FillAutonumber(1, lblProductId);

                pro.sql = "Select CategoryId, Category + '[' + CategoryType + ']'  as 'CategType' From tblcategory";
                pro.FillComboBox(pro.sql, "CategoryId", "CategType", cboCategory);

                string categoryid = cboCategory.SelectedValue.ToString();
                int    id         = Int32.Parse(categoryid);
                pro.PassingAutonumberLbl(id, lblProductId);

                pro.sqlselect = "SELECT ProductId,p.Barcode,ProductName,Description,Category + '[' + CategoryType + ']' as 'Category' ,p.OriginalPrice,MarkupPrice,ProductQty,Unit FROM tblcategory c, tblproduct p  WHERE p.CategoryId=c.CategoryId";
                pro.LoadData(pro.sqlselect, dtglist);
                pro.dtgcolor(dtglist, 7);


                useFunc.clearTxt(this);
            }
            catch
            {
            }
        }
Ejemplo n.º 4
0
 private void frmPurchaseOrder_Load(object sender, EventArgs e)
 {
     pro.sqlselect = "SELECT OrderDate,p.Barcode,ProductName,Description,Category,p.OriginalPrice,OrderQty,Unit,OrderTotal FROM tblcategory c, tblproduct p,tblorder o WHERE p.CategoryId=c.CategoryId AND p.Barcode=o.Barcode";
     pro.LoadData(pro.sqlselect, dtgList);
     txtBarcode.MaxLength = 11;
     pro.FillComboBox("SELECT * FROM tblsupplier", "SupplierId", "Supplier", comboBox1);
     clearStockin();
 }
Ejemplo n.º 5
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            useFunc.clearTxt(this);

            cboRole.Text = "Administrator";

            user.FillAutonumber(2, lblUserId);

            user.sqlselect = "Select UserId,Fullname,User_Name as 'Username',UserRole as 'Role' FROM tbluser";
            user.LoadData(user.sqlselect, dtgList);
        }
Ejemplo n.º 6
0
        private void frmSupplier_Load(object sender, EventArgs e)
        {
            sup.sqlselect = "SELECT * From tblsupplier";
            sup.LoadData(sup.sqlselect, dtgList);

            txtSupplier.Clear();
            txtContactNo.Clear();
            txtCompanyAddress.Clear();
            txtCompany.Clear();
            txtSupplier.Focus();
            supplierid = 0;
        }
Ejemplo n.º 7
0
 private void frmListProducts_Load(object sender, EventArgs e)
 {
     prolist.sqlselect = "SELECT p.Barcode,ProductName,Description,Category,p.OriginalPrice,ProductQty,Unit FROM tblcategory c, tblproduct p WHERE p.CategoryId=c.CategoryId";
     prolist.LoadData(prolist.sqlselect, dtgList);
     prolist.dtgcolor(dtgList, 5);
 }