public IEnumerable <VM_Adjustment> GetVM_Adjustment() { string JsonResponse = LoadDropDown.CallApi(ConfigurationManager.AppSettings["VATApiUrl"] + "/api/" + "VM_Adjustment/GetVM_Adjustment", Session["token"].ToString()); JavaScriptSerializer js = new JavaScriptSerializer(); IEnumerable <VM_Adjustment> VM_AdjustmentList = js.Deserialize <IEnumerable <VM_Adjustment> >(JsonResponse); return(VM_AdjustmentList); }
public ActionResult GetCustomerWiseSaleSummaryRptPdf(CustWiseSaleRptSearchVModel saleRpt) { if (saleRpt.LocCode != null && saleRpt.LocCode != "") { saleRpt.LocCode = Session["LocCode"].ToString(); } saleRpt.RptType = Convert.ToInt32(Session["RptType"]); if (saleRpt.LocCode == null) { saleRpt.LocCode = ""; } if (saleRpt.RptType == 1) { string finYear = Session["FinYear"].ToString(); string JsonResponse = LoadDropDown.CallApi(ConfigurationManager.AppSettings["ApiUrl"] + "/api/" + "CustomerWiseSaleRpt?finYear=" + finYear + "&locCode=" + saleRpt.LocCode.ToString() + "&fdate=" + saleRpt.fDate.ToString("MM/dd/yyyy") + "&tdate=" + saleRpt.toDate.ToString("MM/dd/yyyy"), Session["token"].ToString()); JavaScriptSerializer js = new JavaScriptSerializer(); IEnumerable <CustWiseSummSaleRpt> itemList = js.Deserialize <IEnumerable <CustWiseSummSaleRpt> >(JsonResponse); if (saleRpt.LocCode != null && saleRpt.LocCode != "0" && saleRpt.LocCode != "") { ViewBag.Location = _locationService.All().FirstOrDefault(x => x.LocCode == saleRpt.LocCode.Trim()).LocName.ToString(); } else { ViewBag.Location = "All"; } ViewBag.fDate = saleRpt.fDate.ToString("dd-MMM-yyyy"); ViewBag.tDate = saleRpt.toDate.ToString("dd-MMM-yyyy"); ViewBag.PrintDate = DateTime.Now.ToShortDateString(); //ViewBag.LocCode = new SelectList(_locationService.All().ToList(), "LocCode", "LocName"); if (itemList.ToList().Count == 0) { string errMsg = "There is no data in this combination. Please try again !!!"; return(RedirectToAction("CustomerWiseSaleRptSearch", "RptSalesPurchase", new { errMsg })); } return(new Rotativa.ViewAsPdf("GetCustomerWiseSaleSummaryRptPdf", itemList) { CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\"" }); //return View(itemList); } else { return(View()); } }
public ActionResult GetDrNoteByDrNoteNo(string DrNoteNo) { HttpResponseMessage response = GlobalVariabls.VatApiClient.GetAsync("VM_DrNote/GetVM_DrNote?DrNoteNo=" + DrNoteNo.ToString()).Result; VM_DrNote VM_DrNote = response.Content.ReadAsAsync <VM_DrNote>().Result; string returnValue = ""; if (Convert.ToBoolean(Session["MaintVAT"]) == true) { string respse = LoadDropDown.CallApi(ConfigurationManager.AppSettings["VATApiUrl"] + "/api/VAT/" + "GetVM_6P8?TransNo=" + DrNoteNo.ToString(), Session["token"].ToString()); JavaScriptSerializer js = new JavaScriptSerializer(); returnValue = js.Deserialize <string>(respse); } return(Json(new { VM_DrNote = VM_DrNote, returnValue = returnValue }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetCustomerWiseSaleSummaryRpt(CustWiseSaleRptSearchVModel saleRpt) { if (saleRpt.LocCode == null) { saleRpt.LocCode = ""; } if (saleRpt.RptType == 1) { string finYear = Session["FinYear"].ToString(); string JsonResponse = LoadDropDown.CallApi(ConfigurationManager.AppSettings["ApiUrl"] + "/api/" + "CustomerWiseSaleRpt?finYear=" + finYear + "&locCode=" + saleRpt.LocCode.ToString() + "&fdate=" + saleRpt.fDate.ToString("MM/dd/yyyy") + "&tdate=" + saleRpt.toDate.ToString("MM/dd/yyyy"), Session["token"].ToString()); JavaScriptSerializer js = new JavaScriptSerializer(); IEnumerable <CustWiseSummSaleRpt> itemList = js.Deserialize <IEnumerable <CustWiseSummSaleRpt> >(JsonResponse); if (saleRpt.LocCode != null && saleRpt.LocCode != "0" && saleRpt.LocCode != "") { ViewBag.Location = _locationService.All().FirstOrDefault(x => x.LocCode == saleRpt.LocCode.Trim()).LocName.ToString(); } else { ViewBag.Location = "All"; } ViewBag.fDate = saleRpt.fDate.ToString("dd-MMM-yyyy"); ViewBag.tDate = saleRpt.toDate.ToString("dd-MMM-yyyy"); if (saleRpt.LocCode != null && saleRpt.LocCode != "") { Session["LocCode"] = saleRpt.LocCode; } Session["RptType"] = saleRpt.RptType; //ViewBag.LocCode = new SelectList(_locationService.All().ToList(), "LocCode", "LocName"); if (itemList.ToList().Count == 0) { string errMsg = "There is no data in this combination. Please try again !!!"; return(RedirectToAction("CustomerWiseSaleRptSearch", "RptSalesPurchase", new { errMsg })); } return(View(itemList)); } else { return(View()); } }