public int InsertOrUpdate(BillInfo obj) { ClearParameter(); AddParameter("@billid", obj.BillId); AddParameter("@billno", obj.BillNo); AddParameter("@subtotal", obj.SubTotal); AddParameter("@discountpercent", obj.DiscountPercent); AddParameter("@discountamount", obj.DiscountAmount); AddParameter("@vatpercent", obj.VatPercent); AddParameter("@vatamount", obj.VatAmount); AddParameter("@grandtotal", obj.GrandTotal); AddParameter("@billdate", obj.BillDate); AddParameter("@paymenttype", obj.PaymentType); AddParameter("@tableno", obj.TableNo); AddParameter("@billstatus", obj.BillStatus); AddParameter("@entrydatetime", obj.EntryDatetime); AddParameter("@receivedby", obj.ReceivedBy); AddParameter("@remarks", obj.Remarks); AddParameter("@isclosed", obj.IsClosed); AddParameter("@servicechargepercent", obj.ServiceChargePercent); AddParameter("@servicechargeamount", obj.ServiceChargeAmount); AddParameter("@servicetypeid", obj.ServiceTypeId); AddParameter("@paymenttypeid", obj.PaymentTypeId); AddParameter("@waiterid", obj.WaiterId); AddParameter("@tableid", obj.TableId); AddParameter("@kotno", obj.KotNo); AddParameter("@pax", obj.Pax); AddParameter("@customername", obj.CustomerName); //FetchData("sp_InsertUpdate_BillInfo"); int id = 0; id = InsertOrUpdateData("sp_InsertUpdate_BillInfo"); return id; }
private BillInfo createBillInfoObject() { BillInfo obj = new BillInfo(); if (_billId > 0) { obj.BillNo = txtBillNo.Text; } obj.SubTotal = Convert.ToDecimal(txtSubTotal.Text); obj.BillId = _billId; obj.GrandTotal = Convert.ToDecimal(txtGrandTotal.Text); obj.BillDate = Convert.ToDateTime(dtpBillDate.Value); obj.PaymentType = 1; obj.TableNo = 1; obj.BillStatus = "open"; obj.EntryDatetime = DateTime.Now; obj.ReceivedBy = BaseObject.User_ID; obj.Remarks = txtRemarks.Text; obj.ServiceTypeId = Convert.ToInt32(cmbServiceType.SelectedValue); obj.WaiterId = Convert.ToInt32(cmbWaiter.SelectedValue); obj.TableId = Convert.ToInt32(cmbTableNo.SelectedValue); obj.KotNo = txtKotNo.Text; obj.DiscountPercent = Convert.ToInt32(txtDiscountPer.Text); obj.DiscountAmount = Convert.ToDecimal(txtDiscountAmount.Text); obj.VatPercent = Convert.ToInt32(txtTaxPer.Text); obj.VatAmount = Convert.ToDecimal(txtTaxAmt.Text); obj.ServiceChargePercent = Convert.ToInt32(txtServiceChargePer.Text); obj.ServiceChargeAmount = Convert.ToDecimal(txtServiceChargeAmount.Text); obj.Pax = Convert.ToInt32(txtPax.Text); obj.CustomerName = txtCustomerName.Text; return obj; }