public ActionResult Create(SuperShopSaleViewModel salevm) { try { //var ids = _saleService.Add(Mapper.Map<Sale>(salevm)); var id = _rawSqlService.AddSaleItems(salevm); if (!string.IsNullOrEmpty(salevm.ActionType) && salevm.ActionType == "Invoice") { return(Redirect("/SuperShopSale/ReportSaleMasterDetail/" + id)); } if (!string.IsNullOrEmpty(salevm.ActionType) && salevm.ActionType == "Label") { return(Redirect("/SuperShopSale/ReportLevelPrint/" + id)); } if (!string.IsNullOrEmpty(salevm.ActionType) && salevm.ActionType == "Html") { return(Redirect("/SuperShopSale/HtmlReportPrint/" + id)); } //return JavaScript($"ShowResult('{"Data save successfully."}','{"success"}','{"redirect"}','{"/SuperShopSale/Create"}')"); if (!string.IsNullOrEmpty(salevm.ActionType) && salevm.ActionType == "Print") { return(Redirect("/SuperShopSale?id=" + id)); } return(Redirect("/SuperShopSale")); } catch (Exception ex) { return(JavaScript($"ShowResult('{ex.Message}','failure')")); } }