Exemple #1
0
        public static IList <BO_ReceiptVoucherTable> LoadReceiptVoucher(JQueryDataTableParamModel Param)
        {
            List <BO_ReceiptVoucherTable> lst_receiptVoucherTable = new List <BO_ReceiptVoucherTable>();

            //Param.Start_Date = Param.Start_Date.AddHours(-12);
            Param.End_Date = Param.End_Date.AddDays(1);
            using (AprosysAccountingEntities db_aa = new AprosysAccountingEntities())
            {
                BO_ReceiptVoucherTable obj;
                if (Param.Searchcheckbox)
                {
                    var lst = db_aa.GetSubscriptionVoucherList("", Param.Start_Date, Param.End_Date);
                    foreach (var item in lst.ToList())
                    {
                        obj              = new BO_ReceiptVoucherTable();
                        obj.invoiceNo    = item.InvoiceNo;
                        obj.activityDate = item.ActivityTimestamp;
                        obj.customerName = item.Customer;
                        obj.amount       = item.Amount;

                        lst_receiptVoucherTable.Add(obj);
                    }
                }
                else
                {
                    var lst = db_aa.GetReceiptVoucherList("", 1, Param.Start_Date, Param.End_Date);
                    foreach (var item in lst.ToList())
                    {
                        obj              = new BO_ReceiptVoucherTable();
                        obj.invoiceNo    = item.InvoiceNo;
                        obj.activityDate = item.ActivityTimestamp;
                        obj.customerName = item.Customer;
                        obj.amount       = item.Amount;

                        lst_receiptVoucherTable.Add(obj);
                    }
                }
            }
            if (Param.SearchType != 0)
            {
            }

            // List<BO_ReceiptVoucherTable> ListtoReturn = new List<BO_ReceiptVoucherTable>();
            // ListtoReturn = lst_receiptVoucherTable;
            return(lst_receiptVoucherTable.OrderByDescending(x => (Convert.ToInt32(x.invoiceNo.Remove(0, 4)))).ToList());
        }