public string GetDateFormat()
        {
            ICreditNoteListDAL purCredit = new CreditNoteListDAL();
            var result = purCredit.GetDateFormat();

            return(result);
        }
        public bool SaveSearchJson(string jsonSearch, int ScreenId, string ScreenName)
        {
            ICreditNoteListDAL purCredit = new CreditNoteListDAL();
            var result = purCredit.SaveSearchJson(jsonSearch, ScreenId, ScreenName);

            return(result);
        }
        public string GetLastSelectionData(int ScreenId)
        {
            ICreditNoteListDAL purCredit = new CreditNoteListDAL();
            var result = purCredit.GetLastSelectionData(ScreenId);

            return(result);
        }
        public List <CreditNoteListEntity> GetAllSalesCreditJson(string jsondata, bool?ExcincTax)
        {
            ICreditNoteListDAL purCredit = new CreditNoteListDAL();
            var Creditlist = purCredit.GetAllSalesCreditJson(jsondata, ExcincTax);

            //foreach (var item in Creditlist)
            //{
            //    if (item.CreditDateDateTime != null)
            //    {
            //        item.CreditDate = item.CreditDateDateTime.ToString();

            //    }

            //    if (item.CashChequeNo != null && item.CashChequeNo != "")
            //    {
            //        item.CreditCashNO = item.CashChequeNo;
            //        if (item.CashChequeDateDate != null && item.CashChequeDateDate.Value.Year > 2000)
            //            item.CreditCashDate = item.CashChequeDateDate.ToString();
            //        else item.CreditCashDate = null;
            //        item.CreditCashAmount = item.CashChequeAmount.ToString();
            //    }

            //    else
            //    {
            //        item.CreditCashNO = item.SalesInvoiceNo;
            //        if (item.InvoiceDateDateTime != null && item.InvoiceDateDateTime.Value.Year > 2000)
            //            item.CreditCashDate = item.InvoiceDateDateTime.ToString();
            //        else item.CreditCashDate = null;
            //        item.CreditCashAmount = item.SalesAmount.ToString();
            //    }
            //    switch (item.Status)
            //    {
            //        case 0:
            //            item.StatusString = "All";
            //            break;
            //        case 1:
            //            item.StatusString = "Adjusted";
            //            break;
            //        case 2:
            //            item.StatusString = "UnAdjusted";
            //            break;
            //        case 3:
            //            item.StatusString = "Refunded";
            //            break;
            //        default:
            //            item.StatusString = "All";
            //            break;
            //    }
            //    if (item.SalesInvoiceNo != null && item.SalesInvoiceNo != "")
            //        item.CashCreditNo = item.SalesInvoiceNo;
            //    else if (item.CashChequeNo != null && item.CashChequeNo != "")
            //        item.CashCreditNo = item.CashChequeNo;
            //    else
            //        item.CashCreditNo = null;
            //    item.CreditAmount = item.CreditAmountValue.ToString();

            //}
            return(Creditlist);
        }
        public List <CreditNoteListEntity> GetAllSalesCreditJson(string jsondata, bool?ExcincTax)
        {
            ICreditNoteListDAL purCredit = new CreditNoteListDAL();
            var Creditlist = purCredit.GetAllSalesCreditJson(jsondata, ExcincTax);

            foreach (var item in Creditlist)
            {
                if (item.CreditDateDateTime != null)
                {
                    item.CreditDate = item.CreditDateDateTime.ToString();
                }

                if (item.CashChequeNo != null && item.CashChequeNo != "")
                {
                    item.CreditCashNO = item.CashChequeNo;
                    if (item.CashChequeDateDate != null && item.CashChequeDateDate.Value.Year > 2000)
                    {
                        item.CreditCashDate = item.CashChequeDateDate.ToString();
                    }
                    else
                    {
                        item.CreditCashDate = null;
                    }
                    item.CreditCashAmount = item.CashChequeAmount.ToString();
                }

                else
                {
                    item.CreditCashNO = item.SalesInvoiceNo;
                    if (item.InvoiceDateDateTime != null && item.InvoiceDateDateTime.Value.Year > 2000)
                    {
                        item.CreditCashDate = item.InvoiceDateDateTime.ToString();
                    }
                    else
                    {
                        item.CreditCashDate = null;
                    }
                    item.CreditCashAmount = item.SalesAmount.ToString();
                }
                switch (item.Status)
                {
                case 0:
                    item.StatusString = "All";
                    break;

                case 1:
                    item.StatusString = "Adjusted";
                    break;

                case 2:
                    item.StatusString = "UnAdjusted";
                    break;

                case 3:
                    item.StatusString = "Refunded";
                    break;

                default:
                    item.StatusString = "All";
                    break;
                }
                if (item.SalesInvoiceNo != null && item.SalesInvoiceNo != "")
                {
                    item.CashCreditNo = item.SalesInvoiceNo;
                }
                else if (item.CashChequeNo != null && item.CashChequeNo != "")
                {
                    item.CashCreditNo = item.CashChequeNo;
                }
                else
                {
                    item.CashCreditNo = null;
                }
                item.CreditAmount = item.CreditAmountValue.ToString();
            }
            return(Creditlist);
        }