public static PropertyBandList ViewPropertyBand(Int32 BandID) { PropertyBandList List = new PropertyBandList(); 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 parBandID = new SqlParameter { ParameterName = "BandID", Value = BandID, Direction = ParameterDirection.Input }; List = context.ExecuteStoreQuery<PropertyBandList>("exec SYCOUS.GetPropertyBand @mode,@Field,@FieldValue,@BandID ", parmode, parField, parFieldValue, parBandID).FirstOrDefault(); } catch (Exception ex) { context.Dispose(); throw; } } return List; }
public ActionResult PView(String BandID) { 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 (BandID != null) { String Dec_BandID = BAL.Security.URLDecrypt(BandID); PropertyBandList band = new PropertyBandList(); if ((Dec_BandID != "0") && (Dec_BandID != null)) { band = BAL.PropertyBandModel.ViewPropertyBand(Dec_BandID); } return View(band); } else { return RedirectToAction("Index", "PropertyBand"); } } else { return RedirectToAction("Index", "Home"); } }