Esempio n. 1
0
 protected void AddStock(object parameter)
 {
     try
     {
         selling_history ob = new selling_history();
         ob.id               = 0;
         ob.dealer_id        = SelectedDealer.id;
         ob.product_id       = SelectedProduct.id;
         ob.quantity         = Quantity;
         ob.credit           = 0;
         ob.debit            = Amount;
         ob.transaction_type = (int)InventoryHelper.TransactionType.Debit;
         ob.customer_info    = "";
         ob.payment_type     = PaymentType == null ? "" : PaymentType.Content.ToString();
         ob.payment_date     = DateTime.Now;
         ob.customer_name    = "";
         ob.remarks          = Remarks;
         SellingHistoryServices.AddUpdateSellingHistory(ob);
         ProductServices.UpdateProductStock(ob.product_id);
         //MessageBox.Show("Stock Added");
         InventoryHelper.SuccessAlert("Success", "Stock Added");
         Initialize();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error Occurse::" + ex.ToString());
     }
 }
Esempio n. 2
0
        protected selling_history Converttosellinghistory(ProductSellingEntity ob)
        {
            selling_history temphistory = new selling_history();

            temphistory.dealer_id        = null;
            temphistory.product_id       = ob.ProductId;
            temphistory.quantity         = ob.Quantity;
            temphistory.credit           = ob.Amount;
            temphistory.debit            = 0;
            temphistory.transaction_type = (int)InventoryHelper.TransactionType.Credit;
            temphistory.customer_info    = CustomerInfo;
            temphistory.payment_type     = PaymentType.Content == null ? "" : PaymentType.Content.ToString();
            temphistory.payment_date     = DateTime.Now;
            temphistory.customer_name    = CustomerName;
            temphistory.remarks          = Remarks;

            return(temphistory);
        }
 public static int AddUpdateSellingHistory(selling_history ob)
 {
     return(SellingHistoryProvider.AddUpdateSellingHistory(ob));
 }