public static long SaveFwdCreditNoteHeader(ICreditNote creditNote) { string strExecution = "usp_CN_SaveCreditNoteHeader"; long creditNoteId = 0; using (DbQuery oDq = new DbQuery(strExecution)) { if (creditNote.CRNID != 0) { oDq.AddBigIntegerParam("@CRNID", creditNote.CRNID); } //oDq.AddVarcharParam("@ExportImport", 1, creditNote.ExportImport); oDq.AddDateTimeParam("@CrnDate", creditNote.CrnDate); oDq.AddBigIntegerParam("@InvoiceID", creditNote.InvoiceID); oDq.AddIntegerParam("@LocationID", creditNote.LocationID); oDq.AddIntegerParam("@NVOCCID", creditNote.NVOCCID); oDq.AddIntegerParam("@InvoiceTypeID", creditNote.InvoiceTypeID); oDq.AddIntegerParam("@UserId", creditNote.UserAdded); //if (creditNote.CrnNo != string.Empty) // oDq.AddVarcharParam("@CrnNumber", 40, creditNote.CrnNo); creditNoteId = Convert.ToInt64(oDq.GetScalar()); } return(creditNoteId); }
public ICreditNote GetCreditNoteForView(long CreditNoteId) { ICreditNote creditNote = CreditNoteDAL.GetCreditNoteHeaderForView(CreditNoteId); creditNote.CreditNoteCharges = CreditNoteDAL.GetCreditNoteFooterForView(CreditNoteId); return(creditNote); }
private void BuildCreditNoteEntity(ICreditNote creditNote) { creditNote.CrnDate = Convert.ToDateTime(txtCNDate.Text); creditNote.InvoiceID = Convert.ToInt64(ViewState["INVOICE_ID"]); creditNote.InvoiceTypeID = Convert.ToInt32(ViewState["INVOICETYPE_ID"]); creditNote.LocationID = Convert.ToInt32(ViewState["LOCATION_ID"]); creditNote.NVOCCID = Convert.ToInt32(ViewState["NVOCC_ID"]); creditNote.UserAdded = _userId; }
public static ICreditNote GetfwdCrnHeaderInformation(int InvoiceId) { string strExecution = "[fwd].[usp_CN_GetHeaderInfo]"; ICreditNote creditNote = null; using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddIntegerParam("@InvoiceId", InvoiceId); DataTableReader reader = oDq.GetTableReader(); while (reader.Read()) { creditNote = new CreditNoteEntity(reader); } reader.Close(); } return(creditNote); }
public static ICreditNote GetCreditNoteHeaderForView(long CreditNoteId) { string strExecution = "usp_CN_GetHeaderForView"; ICreditNote creditNote = null; using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddBigIntegerParam("@CreditNoteId", CreditNoteId); DataTableReader reader = oDq.GetTableReader(); while (reader.Read()) { creditNote = new CreditNoteEntity(reader); } reader.Close(); } return(creditNote); }
public long SavefwdCreditNote(ICreditNote CreditNote) { long creditNoteId = 0; long creditNoteChargeId = 0; creditNoteId = CreditNoteDAL.SaveCreditNoteHeader(CreditNote); if (creditNoteId > 0) { if (!ReferenceEquals(CreditNote.CreditNoteCharges, null)) { foreach (ICreditNoteCharge cRate in CreditNote.CreditNoteCharges) { cRate.CRNID = creditNoteId; creditNoteChargeId = CreditNoteDAL.SaveCreditNoteFooter(cRate); } } creditNoteId = CreditNoteDAL.UpdateCRN(creditNoteId); } return(creditNoteId); }