示例#1
0
        public ActionResult VendorTransactionDetailWithDate(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 StringUID = Convert.ToString(UID);
                    var Detail    = db.VendorLedgerReportWithDate(StringUID, fDate, tDate);


                    //var objIpm = db.Vendors.Where(x => x.UID == UID).Select(s => s.Id).FirstOrDefault();


                    //var Detail = (from vp in db.VendorPayments
                    //              join v in db.Vendors on
                    //              vp.VendorId equals v.Id
                    //              where vp.VendorId == objIpm
                    //              && vp.CreatedOn >= fDate && vp.CreatedOn <= tDate
                    //              select new
                    //              {
                    //                  vp.PoNumber,
                    //                  Name = v.Name,
                    //                  vp.EntryType,
                    //                  vp.CreatedOn,
                    //                  Debit = vp.Debit,
                    //                  Credit = vp.Credit,
                    //                  Comment=vp.Comment
                    //              }).ToList();

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

            return(Content(status));
        }