Beispiel #1
0
 public static PropertyLevelList ViewPropertyLevel(Int32 LevelID)
 {
     PropertyLevelList objLevel = new PropertyLevelList();
     using (var context = new SycousCon())
     {
         try
         {
             objLevel = (from p in context.PropertyLevels
                         join C in context.ClientMasters
                         on p.ClientID equals C.ClientID
                         join S in context.SiteMasters
                         on p.SiteID equals S.Id
                         where (p.IsDeleted == 0 && p.ID == LevelID)
                         orderby p.CreateDate descending
                         select new PropertyLevelList()
                         {
                             ID = SqlFunctions.StringConvert((Double)p.ID).Trim(),
                             LevelName = p.LevelName,
                             Client = C.Name,
                             Site = S.SiteName,
                             ClientID = SqlFunctions.StringConvert((Double)C.ClientID).Trim(),
                             SiteID = SqlFunctions.StringConvert((Double)S.Id).Trim()
                         }).FirstOrDefault();
             return objLevel;
         }
         catch (Exception ex)
         {
             context.Dispose();
             throw;
         }
     }
 }
 public ActionResult LView(String Level_ID)
 {
     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 (Level_ID != null)
         {
             String Dec_LevelID = BAL.Security.URLDecrypt(Level_ID);
             PropertyLevelList level = new PropertyLevelList();
             if ((Dec_LevelID != "0") && (Dec_LevelID != null))
             {
                 level = BAL.PropertyLevelModel.ViewPropertyLevel(Dec_LevelID);
             }
             return View(level);
         }
         else
         { return RedirectToAction("Index", "PropertyLevel"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }
        public Object ViewRecord(Int64 LevelID)
        {
            PropertyLevelList level = new PropertyLevelList();
            try
            {
                level = DAL.DALPropertyLevel.ViewPropertyLevel(Convert.ToInt32(LevelID));

            }
            catch (Exception ex)
            {
                throw;
            }
            return level;
        }