public ActionResult ConsumerView(String PropID)
 {
     if (Session["Login"] != null)
       {
       if (PropID != null)
       {
           String Dec_PropID = BAL.Security.URLDecrypt(PropID);
           PropertyList prop = new PropertyList();
           if ((Dec_PropID != "0") && (Dec_PropID != null))
           {
               prop = BAL.PropertyModel.ViewProperty(Dec_PropID);
               ViewBag.TariffList = BAL.PropertyModel.PropertyInTariffList(Convert.ToInt64(Dec_PropID));
           }
           return View(prop);
       }
       else
       { return RedirectToAction("ConsumerIndex", "Property"); }
       }
       else
       { return RedirectToAction("Index", "Home"); }
 }
        public JsonResult PropertyAddress(String mPropertyID)
        {
            if (Session["Login"] != null)
            {
                try
                {
                    LoginSession loginsession = (LoginSession)Session["Login"];
                    if (mPropertyID != null)
                    {
                        PropertyList prop = new PropertyList();
                        prop = BAL.PropertyModel.ViewProperty(mPropertyID);
                        return Json(new {PropertyNo = prop.PropertyNumber, Address = prop.Address1, Address2 = prop.Address2, City = prop.City, County = prop.County, Zipcode = prop.PostCode }, JsonRequestBehavior.AllowGet);

                    }
                }
                catch (Exception ex)
                {
                    return Json(null);
                }

            }
            return Json(null);
        }
        public JsonResult PropertyAddress(String mPropertyID)
        {
            if (Session["Login"] != null)
            {
                try
                {
                    LoginSession loginsession = (LoginSession)Session["Login"];
                    if (mPropertyID != null)
                    {
                        DAL.PropertyList prop = new DAL.PropertyList();
                        prop = BAL.PropertyModel.ViewProperty(mPropertyID);
                        return Json(new { Address = prop.Address1, Address2 = prop.Address2 }, JsonRequestBehavior.AllowGet);

                    }
                }
                catch (Exception ex)
                {
                    return Json(null);
                }

            }
            return Json(null);
        }
Example #4
0
        public static PropertyList ViewProperty(Int64 propID)
        {
            PropertyList objprop = new PropertyList();
               using (var context = new SycousCon())
               {
               try
               {
                   objprop = (from P in context.Properties
                              join C in context.ClientMasters
                               on P.ClientID equals C.ClientID
                              join S in context.SiteMasters
                                    on P.SiteID equals S.Id
                              join B in context.PropertyBands
                                on P.PropertyBrand equals B.ID
                              where (P.IsDeleted == 0 && B.IsDeleted == 0 && P.ID == propID)
                              orderby P.CreateDate descending, P.ModifyDate descending
                              select new PropertyList()
                              {
                                  ID = SqlFunctions.StringConvert((Double)P.ID).Trim(),
                                  PropertyNumber = P.PropertyNumber,
                                  Client = C.Name,
                                  Site = S.SiteName,
                                  Address1 = P.Address1,
                                  Address2 = P.Address2,
                                  City = P.City,
                                  County = P.County,
                                  PostCode = P.PostCode,
                                  PropertyBrand = B.PropertyBand1,
                                  SiteID = SqlFunctions.StringConvert((Double)S.Id).Trim()
                              }).FirstOrDefault();

                   if (objprop != null)
                   { return objprop; }
                   else
                   {
                       objprop = null;
                       return objprop;
                   }
               }
               catch (Exception ex)
               {
                   context.Dispose();
                   throw;
               }
               }
        }
 public ActionResult PView(String PropID)
 {
     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 (PropID != null)
       {
           String Dec_PropID = BAL.Security.URLDecrypt(PropID);
           PropertyList prop = new PropertyList();
           if ((Dec_PropID != "0") && (Dec_PropID != null))
           {
               prop = BAL.PropertyModel.ViewProperty(Dec_PropID);
               ViewBag.TariffList = BAL.PropertyModel.PropertyInTariffList(Convert.ToInt64(Dec_PropID));
           }
           return View(prop);
       }
       else
       { return RedirectToAction("Index", "Property"); }
       }
       else
       { return RedirectToAction("Index", "Home"); }
 }
Example #6
0
 public Object ViewRecord(Int64 PropID)
 {
     PropertyList vwproperty = new PropertyList();
     try
     {
         vwproperty = DALProperty.ViewProperty(Convert.ToInt64(PropID));
     }
     catch (Exception ex)
     {
         throw;
     }
     return vwproperty;
 }