Пример #1
0
        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);
        }
Пример #2
0
        public ICreditNote GetCreditNoteForView(long CreditNoteId)
        {
            ICreditNote creditNote = CreditNoteDAL.GetCreditNoteHeaderForView(CreditNoteId);

            creditNote.CreditNoteCharges = CreditNoteDAL.GetCreditNoteFooterForView(CreditNoteId);

            return(creditNote);
        }
Пример #3
0
 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;
 }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }