Beispiel #1
0
        private void AddLineItem()
        {
             DataRow current = null;
            if (txtbarcode.EditValue != null)
            {
                var blf = new BlItemMaster().FindItemByBarCode(txtbarcode.EditValue.ToString());
                if (blf.Rows.Count == 0)
                {
                    XtraMessageBox.Show("Item master not found", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtbarcode.SelectAll();
                    return;
                }
                foreach (DataRow dr in blf.Rows)
                {
                    current = dr;
                }
            }
            else
            {
                return;
            }
            
            txtbarcode.EditValue = string.Empty;
            var bl = new BLSales();
         //   var aQty = bl.GetStockByItemno(current["ITEMNO"].ToString());
            textEdit2.Text = current["ITEMNAME"].ToString();



            //if (aQty > 0)
            //{
                var dt = bl.GetStock(current["ITEMNO"].ToString());

                foreach (DataRow dr in dt.Rows)
                {
                    
                        DataRow newRow = dtn.NewRow();
                        newRow["QTY"] = dr[0];
                        newRow["SPRICE"] = dr[1];
                        newRow["CPRICE"] = dr[2];
                        newRow["ITEMNO"] = current["ITEMNO"];
                        newRow["BARCODE"] =   current["BARCODE"];


                        newRow["COMPANY"] = Utils.Company;
                        dtn.Rows.Add(newRow);
          //      }

                
            //    CheckForMultiStock(current["ITEMNO"].ToString(), current["ITEMNAME"].ToString());
            }
        }