public Object ViewRecord(Int64 tariffID) { DAL.TariffList vwtariff = new DAL.TariffList(); try { vwtariff = DAL.DALTariff.ViewTariffRecord(Convert.ToInt32(tariffID)); } catch (Exception ex) { throw; } return vwtariff; }
public static TariffList ViewTariffRecord(Int32 TariffID) { TariffList objtariff = new TariffList(); using (var context = new SycousCon()) { try { var parmode = new SqlParameter { ParameterName = "mode", Value = "3", Direction = ParameterDirection.Input }; var parField = new SqlParameter { ParameterName = "Field", Value = "", Direction = ParameterDirection.Input }; var parFieldValue = new SqlParameter { ParameterName = "FieldValue", Value = "", Direction = ParameterDirection.Input }; var PTariffID = new SqlParameter { ParameterName = "TariffID", Value = TariffID.ToString(), Direction = ParameterDirection.Input }; objtariff = context.ExecuteStoreQuery<TariffList>("exec SYCOUS.TariffList @mode,@Field,@FieldValue ,@TariffID", parmode, parField, parFieldValue, PTariffID).FirstOrDefault(); } catch (Exception ex) { context.Dispose(); throw; } } return objtariff; }
public ActionResult EView(String TariffID) { if (Session["Login"] != null) { LoginSession loginsession = (LoginSession)Session["Login"]; ViewBag.CompanyLogo = loginsession.CompanyLogo; ViewBag.Layout1 = BAL.Common.LayoutType(loginsession.UserType); String actionName = this.ControllerContext.RouteData.Values["action"].ToString(); String controllerName = this.ControllerContext.RouteData.Values["controller"].ToString(); ViewBag.Menu = BAL.Common.GetActiveMenu(controllerName, actionName, BAL.Common.LayoutType(loginsession.UserType)); ViewBag.RoleName = loginsession.RoleName; if (TariffID != null) { String Dec_TariffID = BAL.Security.URLDecrypt(TariffID); DAL.TariffList tariff = new DAL.TariffList(); if ((Dec_TariffID != "0") && (Dec_TariffID != null)) { tariff = BAL.TariffModel.ViewTariff(Dec_TariffID); ViewBag.tariffID = tariff.ID; } return View(tariff); } else { return RedirectToAction("Index", "Tariff"); } } else { return RedirectToAction("Index", "Home"); } }