示例#1
0
        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;
                }
                comboBoxEdit1.Properties.Items.Clear();
                foreach (DataRow dr in blf.Rows)
                {
                    if (int.Parse(dr["groupid"].ToString()) == 1)
                    {
                        FillDates(dr["ITEMNO"].ToString());
                        var drn = (DsMaster.DDDETAILSRow) dsMaster1.DDDETAILS.NewRow();
                        drn.ITEMNO = dr["ITEMNO"].ToString();
                        drn.ITEMNAME = dr["ITEMNAME"].ToString();

                        if(comboBoxEdit1.EditValue!=null)
                             drn.EXPDT =  comboBoxEdit1.EditValue.ToString();
                        dsMaster1.DDDETAILS.Rows.Add(drn);
                    }
                }
            }
            else
            {
                return;
            }
            txtbarcode.EditValue = string.Empty;
        }
        void CreateInventoryReport()
        {
            var ds = new StockMaster().GetDististinctItemsInStockMaster(); 
            int i = 0;
            var bl = new BlItemMaster();
            var stk = new StockMaster();
            var bls = new SalesManger();
            foreach (DataRow stockmasterRow in ds.Rows)
            {
                var dr = (Ledgers.InventoryVariationRow)  dt.NewRow();
                dr[0] = i++;
                var itm = stockmasterRow["ITEMNO"].ToString();
                dr.ITEMNO = itm;
                dr.ITEMNAME = bl.GetItemname(itm);
                dr.OPENING = bls.GetOpeningQty(itm);
                dr.RECEIVE = bls.GetReceivedQty(itm);
                dr.RETURN = bls.GetReturnQty(itm);
                dr.SALES = bls.GetSoldQty(itm);
                dr.TRANSFER = bls.GetTransferedQty(itm);
                dr.ADJQTY = bls.GetAdjQty(itm);
                dr.ACTUAL = (dr.OPENING + dr.ADJQTY  + dr.RECEIVE + (-1* dr.RETURN)) - (dr.SALES + dr.TRANSFER);
                dr.INSTOCK = stk.GetAvailableQty(itm);
              //  dr.STOCKID = int.Parse(stockmasterRow["STOCKID"].ToString());
                dt.Rows.Add(dr);
            }
            inventoryVariationBindingSource.DataSource = dt;
            fixstkdiff = false;
            

        }
示例#3
0
 private void ItemList_Load(object sender, EventArgs e)
 {
     var ds = new BlItemMaster().GetRptItemsList();
     //foreach (DataRow dr in ds.Rows)
     //{
     //    dr["Stock"] = new BLSales().GetAvailableQty(dr["ITEMNO"].ToString());
     //}
     itemsListBindingSource.DataSource = ds;
 }
示例#4
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());
            }
        }
 private void textEdit1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (textEdit1.EditValue != null)
         {
             var blf = new BlItemMaster().FindItemByBarCode(textEdit1.EditValue.ToString());
             if (blf.Rows.Count == 0)
             {
                 XtraMessageBox.Show("Item master not found", "POS", MessageBoxButtons.OK,
                     MessageBoxIcon.Information);
                 textEdit1.SelectAll();
             }
             else
             {
                 foreach (DataRow dr in blf.Rows)
                 {
                     textEdit2.EditValue = dr["ITEMNAME"].ToString();
                 }
                 GetData();
             }
         }
     }
 }
示例#6
0
 public DsMaster.TEMPBCODEPRINTDataTable CreateBarCodeTable(string purno)
 {
     var dt = new DsMaster().TEMPBCODEPRINT;
     var dm = new PurInvDataManager();
     Purinvdetail = dm.GetPurInvDetailsById(purno);
     foreach (DataRow dr in Purinvdetail.Rows)
     {
         var dnew = dt.NewRow();
         dnew["ITEMCODE"] = dr["itemno"];
         dnew["ITEMNAME"] = new BlItemMaster().GetItemname(dr["itemno"].ToString());
         var _qty = int.Parse(dr["qty"].ToString()) + (string.IsNullOrEmpty(dr["BONUSQTY"].ToString()) ? 0 : int.Parse(dr["BONUSQTY"].ToString()));
         dnew["QTY"] = _qty;
         dnew["PRICE"] = dr["SPRICE"];
         dt.Rows.Add(dnew);
     }
     return dt;
 }
示例#7
0
 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;
     }
         _DISCONSALE = false;
         _discount = 0m;
         var SPRICE = 0m;
         var CPRICE = 0m;
         var purdiscout = 0m;
         if (!string.IsNullOrEmpty(current["DISCOUNT"].ToString()))
             purdiscout = decimal.Parse(current["DISCOUNT"].ToString());
         if (!string.IsNullOrEmpty(current["SPRICE"].ToString()))
             SPRICE = decimal.Parse(current["SPRICE"].ToString());
         if (!string.IsNullOrEmpty(current["CPRICE"].ToString()))
         {
             CPRICE = decimal.Parse(current["CPRICE"].ToString());
         }
         txtbarcode.EditValue = string.Empty;
         if (_isreturn)
         {
             DoReturn(current);
             return;
         }
         var bl = new BLSales();
         var aQty = bl.GetAvailableQty(current["ITEMNO"].ToString());
         if(aQty > 0)
         {
             CheckForMultiStock(current["ITEMNO"].ToString(),current["ITEMNAME"].ToString());
         }
         else
         {
             var dStockmasterRow = (DsInventory.STOCKMASTERRow)dsInventory1.STOCKMASTER.NewRow();
             dStockmasterRow.ITEMNO = current["ITEMNO"].ToString();
             dStockmasterRow.BARCODE = current["BARCODE"].ToString();
             dStockmasterRow.DQNTY = 1;
             dStockmasterRow.CPRICE = CPRICE;
             dStockmasterRow.QTY = 0;
             if (SPRICE == 0)
             {
                 SPRICE = new BLSales().GetSalesPriceByItemno(current["ITEMNO"].ToString());
             }
             var f = LoadQtyMoreForm(current["ITEMNO"].ToString(), current["ITEMNAME"].ToString(), aQty, 1, 0, 1, SPRICE, true, true, dStockmasterRow, purdiscout);
             if (f.iscontinue == 1)
             {
                 //GetStockItemBySprice
                 var dnewstock = new BLSales().GetStockItem(current["ITEMNO"].ToString(), "S");
                 if(f.salesprice !=SPRICE)
                 {
                     dnewstock = new BLSales().GetStockItemBySprice(current["ITEMNO"].ToString(),f.salesprice);
                 }
                 
                 foreach(DsInventory.STOCKMASTERRow dr in dnewstock.Rows)
                 {
                     dr.DQNTY = f.enterqty;
                 }
              // var topRows = dnewstock.AsEnumerable().OrderBy(o => o.Field<int>("STOCKID")).Take(1).ToList().CopyToDataTable();
                 string itemno = current["ITEMNO"].ToString();
                 var t = NotifyItems.Find(match => match == itemno);
                 if(t!=null)
                     NotifyItems.Add(itemno);
                  AddMultipleItems(dnewstock, current["ITEMNAME"].ToString(), f.isBlankStock);
             }
         }
         UpdateTotal();
         txtbarcode.EditValue = String.Empty;
     //}
 }
示例#8
0
 private void BarcodeValidating(object sender, CancelEventArgs e)
 {
     if(barcode.EditValue==null) return;
     var bl = new BlItemMaster().FindItemByBarCode(barcode.EditValue.ToString());
     if(bl.Rows.Count>0)
     {
         XtraMessageBox.Show("Duplicate bar code", "POS", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     foreach (DataRow dr in bl.Rows)
     {
         _itemno = dr["ITEMNO"].ToString();
         DoView(_itemno);
     }
 }
示例#9
0
 bool DoSave()
 {
     bool retval = false;
     if (DoValidate())
     {
         var newrow =(DsMaster.ITEMMASTRow) new DsMaster().ITEMMAST.NewRow();
             newrow.ITEMNO = _itemno;
             newrow.ITEMTYPE = int.Parse(itemtype.EditValue.ToString());
             newrow.OWNBARCODE = ownbarcode.Checked;
             newrow.BARCODE = barcode.Text;
             newrow.ITEMNAME = itemname.Text;
             newrow.ARITEMNAME = aritemname.Text;
             newrow.BASEUOM = int.Parse(buom.EditValue.ToString());
             newrow.SUPPLIERNO = supplier.EditValue.ToString();
             newrow.MANFNAME = manfact.Text;
             newrow.REORDER = reorder.EditValue==null?0:int.Parse(reorder.Text);
             newrow.UOM = int.Parse(uom.EditValue.ToString());
             newrow.PRINTBARCODE = printbarcode.Checked;
             newrow.EXPDATEREQ = expdatereq.Checked;
             newrow.ACTIVE = active.Checked;
             newrow.CATEGORY = int.Parse(itemcat.EditValue.ToString());
             newrow.GROUPID = int.Parse(itemgroup.EditValue.ToString());
             newrow.GENERICID = genname.EditValue == null ? 0 : int.Parse(genname.EditValue.ToString());
             newrow.MARGIN = margin.EditValue==null?0:decimal.Parse(margin.EditValue.ToString());
             newrow.MARKUP = markup.EditValue == null ? 0 : decimal.Parse(markup.EditValue.ToString());
             newrow.DISCOUNT = discount.EditValue == null ? 0 : decimal.Parse(discount.EditValue.ToString());
             newrow.FASTMOVING = fastmoving.Checked;
             newrow.LOCATION = location.Text;
             newrow.TEMPRATURE = temprature.Text;
             newrow.MINQTY = minqty.EditValue == null ? 0 : int.Parse(minqty.EditValue.ToString());
             newrow.MAXQTY = maxqty.EditValue == null ? 0 : int.Parse(maxqty.EditValue.ToString());
             newrow.CPRICE = ORDERCOST.EditValue == null?0:decimal.Parse(ORDERCOST.EditValue.ToString());
             newrow.SPRICE = REGULARPRICE.EditValue == null?0:decimal.Parse(REGULARPRICE.EditValue.ToString());
             newrow.ITEMDEM = ITEMDEM.EditValue == null ? string.Empty : ITEMDEM.EditValue.ToString();
             newrow.COLOR= COLOR.EditValue == null?string.Empty: COLOR.EditValue.ToString();
             newrow.WEIGHT= WEIGHT.EditValue == null?string.Empty: WEIGHT.EditValue.ToString();
             newrow.POMINQTY = minpoqty.EditValue == null ? 0 : int.Parse(minpoqty.EditValue.ToString());
             newrow.POMAXQTY = maxpoqty.EditValue == null ? 0 : int.Parse(maxpoqty.EditValue.ToString());
             newrow.DISCONSALE = checkBox1.Checked;
             newrow.SALEDISCOUNTPER = SALEDISCOUNTPER.EditValue == null?0: decimal.Parse(SALEDISCOUNTPER.EditValue.ToString());
             
             var bl = new BlItemMaster {Itemmast = newrow,Itemno = _itemno};
             var ret = bl.DoSave();
             if(ret=="1")
             {
                 retval = true;
                 XtraMessageBox.Show("Data Saved", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 if (string.IsNullOrEmpty(_itemno))
                 _itemno = bl.Itemno;
                 txtourcode.Text = _itemno;
             }
             else
             {
                 retval = false;
                 XtraMessageBox.Show(ret, "POS", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             //var proxy = new DataManager();
            // this.dsInventory1.Merge(proxy.GetItemMast());
             dsMaster.Merge(new BlItemMaster().GetItemMastList());
     }
     return retval;
 }
示例#10
0
        public DsMaster.TEMPBCODEPRINTDataTable CreateBarCode(string  tranid )
        {
            var dt = new DsMaster().TEMPBCODEPRINT;
            Itemtransferdetail = GetItemTranferDetails(tranid);
            foreach (DataRow dr in Itemtransferdetail.Rows)
            {
                var dnew = dt.NewRow();
                dnew["ITEMCODE"] = dr["itemno"];
                dnew["ITEMNAME"] = new BlItemMaster().GetItemname(dr["itemno"].ToString());
                dnew["QTY"] = dr["qty"];
                dnew["PRICE"] = dr["SPRICE"];
                dt.Rows.Add(dnew);
            }
             

            return dt;
        }
示例#11
0
 public void GeneratePOFrmPR(DsPurchase.PURCHASEREQUESTDataTable dt)
 {
    // LookupSupplier.EditValue = supno;
     foreach (DataRow dr in dt.Rows)
     {
         if (dr["INORDER"].ToString() == bool.TrueString)
         {
             LookupSupplier.EditValue = dr["SUPPLIERNO"].ToString();
             var blf = new BlItemMaster().FindItemByBarCode(dr["ITEMNO"].ToString());
             foreach (DataRow drt in blf.Rows)
             {
                 AddItemsToList("True", drt, int.Parse(dr["QTY"].ToString()));
             }
         }
     }
     ShowDialog();
 }
示例#12
0
        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if(e.KeyCode==Keys.Enter)
            {
              //  if (!itemfoundingrid())
              //  {
                    var blf = new BlItemMaster().FindItemByBarCode(textBox1.Text);
                    if (blf.Rows.Count == 0)
                    {
                        XtraMessageBox.Show("Item not found", "POS", MessageBoxButtons.OK,MessageBoxIcon.Information);
                        textBox1.Clear();
                    }
                    else
                    {
                       var dr = blf.Rows[0];
                       var drs = new ItemMaster().GetSPCPEXPDtFromImportedPurchaseFile(dr["itemno"].ToString(), dr["barcode"].ToString());
                       sPCPRICEFROMHISTBindingSource.DataSource = drs;
                       if(drs.Rows.Count >0)
                        lookUpEdit1.EditValue =drs.Rows[0]["sprice"];
                       txtstock.EditValue = 0;
                       textBox1.Text = dr["itemno"].ToString();
                       txtbarcode.Text = dr["barcode"].ToString();
                       // txtsprice.EditValue = new ItemMaster().GetItemSalesPrice(dr["itemno"].ToString());
                       //txtcprice.EditValue = new ItemMaster().GetItemCostPrice(dr["itemno"].ToString());

                       txxitemname.Text = dr["itemname"].ToString(); //textBox1.Tag  = drs["ITCD"]
                       txtgrpid.Text  = dr["GROUPID"].ToString();

                        string dt = new BLSales().GetExpiryDt(dr["ITEMNO"].ToString());
                        if(!String.IsNullOrEmpty(dt))
                        {
                         DateTime ndt = DateTime.Parse(dt);
                         txtexpdate.Text = ndt.Month + " - " + ndt.Year;
                        }
                       button1.Enabled = true;
                        txtstock.Focus();

                  //  }
                }
                //else
                //{
                //    button1.Enabled = false;
                //}
            }
            if (e.KeyCode == Keys.F10)
            {
                KeyF10();
            }
        }
示例#13
0
 void FindItem(string line, string machno, string inventoryby,int Yearclosed)
 {
   var split =line.Split(',');
   var blf = new BlItemMaster().FindItemByBarCode(split[0]);
     try
     {
         if (blf.Rows.Count == 0)
         {
             AppendDataToGrid(split[0], split[0], "*******", 0, int.Parse(split[1]), null, machno, inventoryby,
                 Yearclosed, true);
         }
         else
         {
             foreach (DataRow dr in blf)
             {
                 AppendDataToGrid(dr["ITEMNO"].ToString(), dr["BARCODE"].ToString(), dr["ITEMNAME"].ToString(),
                     int.Parse(dr["GROUPID"].ToString()), int.Parse(split[1]), null, machno, inventoryby,
                     Yearclosed);
             }
         }
     }
     catch (Exception ex)
     {}
 }