Esempio n. 1
0
        public bool AddPriceByBarcode(string barcode, int userid)
        {
            bool res;

            dt = new DataTable();
            dt = pros.SearchByBarcode(barcode);
            if (dt.Rows.Count == 1)
            {
                DataRow row   = dt.Rows[0];
                int     proid = Convert.ToInt32(row["ProID"].ToString());
                p             = new Price();
                p.ProID       = proid;
                p.Barcode     = barcode;
                p.PriceNew    = 0.00m;
                p.PriceDate   = DateTime.Now.Date;
                p.AddedBy     = userid;
                p.PriceStatus = "InActive";

                res = AddProductToPrices(p);
            }
            else
            {
                res = false;
            }

            return(res);
        }
Esempio n. 2
0
 private void txt_barcode_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (txt_barcode.Text != "")
         {
             dt = new DataTable();
             dt = pros.SearchByBarcode(txt_barcode.Text);
             DataRow row = dt.Rows[0];
             txt_proID.Text       = row["ProID"].ToString();
             txt_productName.Text = row["ProName"].ToString();
         }
         else
         {
             return;
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 3
0
        public bool AddByBarcode(string barcode)
        {
            bool res;

            dt = new DataTable();
            dt = pros.SearchByBarcode(barcode);
            if (dt.Rows.Count == 1)
            {
                DataRow row   = dt.Rows[0];
                int     proid = Convert.ToInt32(row["ProID"].ToString());
                s             = new Stock();
                s.ProID       = proid;
                s.Barcode     = barcode;
                s.Quantity    = 0;
                s.StockStatus = "Out of Stock";
                res           = AddStock(s);
            }
            else
            {
                res = false;
            }

            return(res);
        }