/// <summary> /// Method to Save the Orders /// </summary> /// <param name="objBill"></param> /// <param name="orders"></param> /// <returns></returns> public int GenerateInvoice(BillMaster objBill, RowOrderMaster[] orders) { foreach (var Order in orders) { objContext.AddToRowOrderMasters(Order); } objContext.AddToBillMasters(objBill); int Res = objContext.SaveChanges(); if (Res > 0) { Res = 1; } return Res; }
/// <summary> /// Create a new BillMaster object. /// </summary> /// <param name="invoiceNo">Initial value of the InvoiceNo property.</param> /// <param name="dealerID">Initial value of the DealerID property.</param> /// <param name="totalBill">Initial value of the TotalBill property.</param> public static BillMaster CreateBillMaster(global::System.Int32 invoiceNo, global::System.Int32 dealerID, global::System.Int32 totalBill) { BillMaster billMaster = new BillMaster(); billMaster.InvoiceNo = invoiceNo; billMaster.DealerID = dealerID; billMaster.TotalBill = totalBill; return billMaster; }
/// <summary> /// Deprecated Method for adding a new object to the BillMasters EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBillMasters(BillMaster billMaster) { base.AddObject("BillMasters", billMaster); }