private void updatePurchase() { bool Status = false; string StatusDetails = null; try { ModelClass.ModelPOS.ModelPurchaseNStock md = new ModelClass.ModelPOS.ModelPurchaseNStock(); MainClass.POS.usp_UpdatePurchaseWithStock(Convert.ToInt32(textBoxQty.Text), Convert.ToInt32(textBoxActualPrice.Text), Convert.ToInt32(textBoxPurchaseUnitPrice.Text), Convert.ToInt32(textBoxPurchaseTotalPrice.Text), textBoxBarcode.Text, dtPurchase.Value, Convert.ToInt32(cbSupplier.SelectedValue.ToString()), Convert.ToInt32(labelPurchaseID.Text), out Status, out StatusDetails); if (Status) { JIMessageBox.InformationMessage(StatusDetails); Clear(); gridViewPurchase.Rows.Clear(); displayPurchase(); } else { MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void createPurchase() { bool Status = false; string StatusDetails = null; try { ModelClass.ModelPOS.ModelPurchaseNStock md = new ModelClass.ModelPOS.ModelPurchaseNStock(); md.Product_ID = mp.ProductID; //From_GridView_Row md.ActualPrice = int.Parse(textBoxActualPrice.Text.ToString()); md.PurchaseUnitPrice = int.Parse(textBoxPurchaseUnitPrice.Text.ToString()); md.PurchaseQty = int.Parse(textBoxQty.Text.ToString()); md.PurchaseTotalPrice = int.Parse(textBoxPurchaseTotalPrice.Text.ToString()); //Category_ID = int.Parse(comboBocCategory.SelectedValue.ToString()), md.Supplier_ID = Convert.ToInt32(cbSupplier.SelectedValue.ToString()); md.CreatedByUser_ID = ModelClass._UserID; md.BarCode = textBoxBarcode.Text; md.PurchaseDate = DateTime.Parse(dtPurchase.Value.ToString());//string.Format("{0}", dtPurchase.Value.ToString("dddd, dd MMMM yyyy"))); MainClass.POS.PurchaseCreate(md, out Status, out StatusDetails); if (Status) { JIMessageBox.InformationMessage(StatusDetails); Clear(); gridViewPurchase.Rows.Clear(); displayPurchase(); } else { MessageBox.Show(StatusDetails, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }