Ejemplo n.º 1
0
 public ActionResult GetSalesDetailsByVoucher(string voucherNo)
 {
     if (voucherNo.Contains("DR") || voucherNo.Contains("dr") || voucherNo.Contains("SO"))
     {
         List <SalesDetail> category = this.salesService.GetAllSalesDetails(voucherNo);
         if (category == null)
         {
             category = new List <SalesDetail>();
         }
         var result = AutoMapper.Mapper.Map <List <SalesDetail>, List <SalesDetailResponse> >(category);
         return(Json(result, JsonRequestBehavior.AllowGet));
     }
     else
     {
         var result = Mapper.Map <List <LedgerPostingResponse> >(service.GetByVoucherNo(voucherNo));
         return(Json(result, JsonRequestBehavior.AllowGet));
     }
 }
Ejemplo n.º 2
0
        //public ActionResult GetAllPaddyReceives()
        //{
        //    List<ReceiveMaster> receive = service.GetAllPaddyRecieveForReport();
        //    if (receive == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    var result = AutoMapper.Mapper.Map<List<ReceiveMaster>, List<ReceiveMasterResponse>>(receive);
        //    return Json(result, JsonRequestBehavior.AllowGet);
        //}

        public ActionResult GetAllPaddyReceivesDetails(string voucherNo)
        {
            if (voucherNo.Contains("GR") || voucherNo.Contains("gr"))
            {
                List <ReceiveDetail> receive = service.GetAllPaddyRecieveForReport(voucherNo);
                if (receive == null)
                {
                    return(HttpNotFound());
                }

                var result = Mapper.Map <List <ReceiveDetail>, List <ReceiveDetailResponse> >(receive);
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var result = Mapper.Map <List <LedgerPostingResponse> >(ledgerService.GetByVoucherNo(voucherNo));
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
        }