public ActionResult AddGst() { GstTaxModel gm = new GstTaxModel(); gm.CountryList = new SelectList(dropdown.BindCountry(), "Value", "Text"); gm.StateList = new SelectList(Enumerable.Empty <SelectList>()); gm.GstcategoryList = new SelectList(dropdown.BindGst(null), "Value", "Text"); gm.DeviceCategoryList = new SelectList(dropdown.BindCategory(CurrentUser.CompanyId), "Value", "Text"); gm.DeviceSubCategoryList = new SelectList(Enumerable.Empty <SelectList>()); gm.ApplicableTaxTypeList = new SelectList(CommonModel.GetApplicationTax(), "Value", "Text"); gm.GstHSNCodeList = new SelectList(dropdown.BindGstHsnCode(), "Value", "Text"); gm.SACList = new SelectList(CommonModel.SAC_NumberList(), "Text", "Text"); gm.CTHNumberList = new SelectList(CommonModel.CTH_NumberList(), "Text", "Text"); return(View(gm)); }
public ActionResult AddGst(GstTaxModel model) { try { if (ModelState.IsValid) { using (var con = new SqlConnection(_connectionString)) { var result = con.Query <int>("Add_Edit_Delete_GstTax", new { model.GstTaxId, model.CountryId, //StateId=model.State, model.StateId, model.Applicable_Tax, model.GstCategoryId, model.Device_Cat, model.Device_SubCat, model.GstHeading, model.Gst_HSNCode_Id, model.CTH_NumberId, model.SACId, Product_Sale_Range = model.Product_Sale_From + "-" + model.Product_Sale_TO, model.CGST, model.SGST, model.IGST, model.Product_Cat, model.Product_SubCat, model.Description_Goods, model.Gst_Applicable_date, model.IsActive, model.Comments, User = CurrentUser.UserId, CurrentUser.CompanyId, Action = "I" }, commandType: CommandType.StoredProcedure).FirstOrDefault(); var response = new ResponseModel(); if (result == 1) { response.IsSuccess = true; response.Response = "Submitted Successfully"; TempData["response"] = response; } else { response.IsSuccess = true; response.Response = "Something Went Wrong"; TempData["response"] = response; } } //return View(model); return(RedirectToAction("Gst")); } } catch (Exception e) { Console.WriteLine(e); throw; } return(RedirectToAction("Gst")); }