Exemplo n.º 1
0
        public ActionResult CustomerTransactionDetailWithDate(Guid UID, DateTime fDate, DateTime tDate)
        {
            var status = "error";

            try
            {
                tDate = tDate.AddDays(1);
                fDate = fDate.AddDays(-1);


                if (!Authenticated)
                {
                    status = "Session Expired";
                }
                else
                {
                    var objIpm    = db.Customers.Where(x => x.UID == UID).Select(s => s.Id).FirstOrDefault();
                    var StringUID = Convert.ToString(UID);
                    var Detail    = db.CustomerLedgerReportWithDateRange(StringUID, fDate, tDate);

                    //var Detail = (from cp in db.CustomerPayments
                    //              join c in db.Customers on
                    //              cp.CustomerId equals c.Id
                    //              where cp.CustomerId == objIpm
                    //              && cp.CreatedOn>=fDate && cp.CreatedOn <=tDate
                    //              select new
                    //              {
                    //                  cp.SoNumber,
                    //                  Name = c.Name,
                    //                  cp.EntryType,
                    //                  cp.CreatedOn,
                    //                  Debit = cp.Debit,
                    //                  Credit = cp.Credit,
                    //              }).ToList();

                    status = JsonConvert.SerializeObject(Detail);
                }
            }
            catch (Exception ex)
            {
                ApplicationExceptionLogging(ex.Message, ex.StackTrace, "ReportsController", "PoDetail");
            }

            return(Content(status));
        }