private void txtPQty_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { SalesBillModel sbm = new SalesBillModel(); sbm.ProductName = txtProducts.Text; BatchMaster batchMaster = (BatchMaster)BatchNumberGridView.SelectedItem; sbm.BatchNo = batchMaster.BatchNo; sbm.Expiry = batchMaster.Expiry; sbm.MRP = batchMaster.MRP; sbm.Qty = Convert.ToDecimal(txtPQty.Text); salesBillViewModel.AddNewRow(sbm); SalesGridView.ItemsSource = salesBillViewModel.objSalesBillM.ListSalesBillModel; txtProducts.Text = "@"; txtPQty.Text = ""; txtTotalQty.Text = SalesBillViewModel.TotalQty.ToString(); txtTotalAmount.Text = SalesBillViewModel.TotalAmount.ToString("0.00"); batchMasterViewModel.objBatchMaster.BatchMasterListByProductCode("-1"); BatchNumberGridView.ItemsSource = batchMasterViewModel.objBatchMaster.ListBatchMaster; BatchNumberGridView.SelectedIndex = 0; txtProducts.Focus(); SalesGridView.SelectedIndex = salesBillViewModel.objSalesBillM.ListSalesBillModel.Count; //txtProducts.selections //salesBillViewModel.CurrentRow.BatchNo = batchMaster.BatchNo; //salesBillViewModel.CurrentRow.BatchNo = batchMaster.BatchNo; //salesBillViewModel.CurrentRow.BatchNo = batchMaster.BatchNo; //salesBillViewModel.CurrentRow.BatchNo = batchMaster.BatchNo; } }
public void AddNewRow(SalesBillModel saledBillModel) { //CurrentRow = saledBillModel; //totalamt = totalamt + (saledBillModel.MRP * saledBillModel.Qty); //totalqty = totalqty + Convert.ToInt16(saledBillModel.Qty); //CurrentRow.TotalAmount = Math.Round(totalamt, 2); //CurrentRow.TotalQty = totalqty; TotalQty = TotalQty + Convert.ToInt16(saledBillModel.Qty); TotalAmount = TotalAmount + (saledBillModel.MRP * saledBillModel.Qty);; saledBillModel.SrNo = objSalesBillM.ListSalesBillModel.Count() + 1; objSalesBillM.ListSalesBillModel.Add(saledBillModel); }
public void AddNewRow(object obj) { SalesBillModel sbm = new SalesBillModel(); sbm.ProductName = pName; sbm.BatchNo = selectedBatchNo.BatchNo; sbm.Expiry = selectedBatchNo.Expiry; sbm.MRP = selectedBatchNo.MRP; sbm.Qty = Convert.ToInt32(obj); sbm.SrNo = objSalesBillM.ListSalesBillModel.Count() + 1; objSalesBillM.ListSalesBillModel.Add(sbm); CurrentRow = sbm; objProductMaster.TotalQty = objProductMaster.TotalQty + Convert.ToInt32(obj); objProductMaster.TotalAmount = objProductMaster.TotalAmount + (sbm.MRP * sbm.Qty); }
public void RemoveRow(SalesBillModel saledBillModel) { objSalesBillM.ListSalesBillModel.Remove(saledBillModel); }