public string GetDateFormat()
        {
            IPurchaseInvoiceListDAL purInvoice = new PurchaseInvoiceListDAL();
            var result = purInvoice.GetDateFormat();

            return(result);
        }
        public string GetLastSelectionData()
        {
            IPurchaseInvoiceListDAL purInvoice = new PurchaseInvoiceListDAL();
            var result = purInvoice.GetLastSelectionData();

            return(result);
        }
        public bool SaveSearchJson(string jsonSearch, int ScreenId, string ScreenName)
        {
            IPurchaseInvoiceListDAL purInvoice = new PurchaseInvoiceListDAL();
            var result = purInvoice.SaveSearchJson(jsonSearch, ScreenId, ScreenName);

            return(result);
        }
        public List <PurchaseInvoiceListEntity> GetAllPurInvoiceJson(string jsondata, bool?ExcincTax)
        {
            IPurchaseInvoiceListDAL purInvoice = new PurchaseInvoiceListDAL();
            var Invoicelist = purInvoice.GetAllPurInvoiceJson(jsondata, ExcincTax);

            foreach (var item in Invoicelist)
            {
                if (item.InvoiceDateDateTime != null)
                {
                    item.InvoiceDate = item.InvoiceDateDateTime.ToString();
                }
                //if (item.CashChequeNo != null && item.CashChequeNo != "")
                //    item.DebitCashNO = item.CashChequeNo;
                //else
                //    item.DebitCashNO = item.DebitNoteNo;
                //if (item.CashChequeDateDate != null && item.CashChequeDateDate.Value.Year>2000)
                //    item.DebitCashDate = item.CashChequeDateDate.ToString();
                //else if(item.DebitNoteDateDate!=null && item.DebitNoteDateDate.Value.Year > 2000)
                //    item.DebitCashDate = item.DebitNoteDateDate.ToString();
                //if (item.CashChequeAmount != null && item.CashChequeAmount != 0)
                //    item.DebitCashAmount = item.CashChequeAmount;
                //else if (item.DebitNoteAmount != null && item.DebitNoteAmount != 0)
                //    item.DebitCashAmount = item.DebitNoteAmount;
                if (item.CashChequeNo != null && item.CashChequeNo != "")
                {
                    item.DebitCashNO = item.CashChequeNo;
                    if (item.CashChequeDateDate != null && item.CashChequeDateDate.Value.Year > 2000)
                    {
                        item.DebitCashDate = item.CashChequeDateDate.ToString();
                    }
                    else
                    {
                        item.DebitCashDate = null;
                    }
                    item.DebitCashAmount = item.CashChequeAmount.ToString();
                }

                else
                {
                    item.DebitCashNO = item.DebitNoteNo;
                    if (item.DebitNoteDateDate != null && item.DebitNoteDateDate.Value.Year > 2000)
                    {
                        item.DebitCashDate = item.DebitNoteDateDate.ToString();
                    }
                    else
                    {
                        item.DebitCashDate = null;
                    }
                    item.DebitCashAmount = item.DebitNoteAmount.ToString();
                }
                switch (item.Status)
                {
                case 0:
                    item.StatusString = "All";
                    break;

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

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

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

                case 4:
                    item.StatusString = "Cancelled";
                    break;

                default:
                    item.StatusString = "All";
                    break;
                }
                if (item.DebitNoteNo != null && item.DebitNoteNo != "")
                {
                    item.CashDebitNo = item.DebitNoteNo;
                }
                else if (item.CashChequeNo != null && item.CashChequeNo != "")
                {
                    item.CashDebitNo = item.CashChequeNo;
                }
                else
                {
                    item.CashDebitNo = null;
                }
                item.InvoiceAmount = item.InvoiceAmountValue.ToString();
            }
            return(Invoicelist);
        }
        public List <PurchaseInvoiceListEntity> GetAllPurInvoice()
        {
            IPurchaseInvoiceListDAL purInvoice = new PurchaseInvoiceListDAL();
            var Invoicelist = purInvoice.GetAllPurInvoice();

            foreach (var item in Invoicelist)
            {
                if (item.InvoiceDateDateTime != null)
                {
                    item.InvoiceDate = item.InvoiceDateDateTime.ToString();
                }
                if (item.CashChequeNo != null && item.CashChequeNo != "")
                {
                    item.DebitCashNO     = item.CashChequeNo;
                    item.DebitCashDate   = item.CashChequeDateDate.ToString();
                    item.DebitCashAmount = item.CashChequeAmount.ToString();
                }

                else
                {
                    item.DebitCashNO     = item.DebitNoteNo;
                    item.DebitCashDate   = item.DebitNoteDateDate.ToString();
                    item.DebitCashAmount = item.DebitNoteAmount.ToString();
                }
                switch (item.Status)
                {
                case 0:
                    item.StatusString = "All";
                    break;

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

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

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

                case 4:
                    item.StatusString = "Cancelled";
                    break;

                default:
                    item.StatusString = "All";
                    break;
                }


                if (item.DebitNoteNo != null && item.DebitNoteNo != "")
                {
                    item.CashDebitNo = item.DebitNoteNo;
                }
                else if (item.CashChequeNo != null && item.CashChequeNo != "")
                {
                    item.CashDebitNo = item.CashChequeNo;
                }
                else
                {
                    item.CashDebitNo = null;
                }
                item.InvoiceAmount = item.InvoiceAmountValue.ToString();
            }
            return(Invoicelist);
        }