Beispiel #1
0
 Object IRecord2View.RecordView(String PropertyID, String MeterID)
 {
     DAL.MeterSearchList Vwdetails = new MeterSearchList();
        try
        {
        Vwdetails = DAL.DALSearch.MeterSearchRecordView(PropertyID, MeterID);
        }
        catch (Exception ex)
        {
        throw;
        }
        return Vwdetails;
 }
Beispiel #2
0
 public Object GetRecord( String PropertyID)
 {
     DAL.MeterSearchList Vwdetails = new MeterSearchList();
        try
        {
        Vwdetails = DAL.DALSearch.MeterSearchRecordView(PropertyID);
        }
        catch (Exception ex)
        {
        throw;
        }
        return Vwdetails;
 }
Beispiel #3
0
 public static MeterSearchList MeterSearchRecordView(String PropertyID, String MeterID)
 {
     MeterSearchList List = new MeterSearchList();
     using (var context = new SycousCon())
     {
         try
         {
             var pPropertyID = new SqlParameter
             {
                 ParameterName = "PropertyID ",
                 Value = PropertyID,
                 Direction = ParameterDirection.Input
             };
             var pMeterID = new SqlParameter
             {
                 ParameterName = "MeterID",
                 Value = MeterID,
                 Direction = ParameterDirection.Input
             };
             List = context.ExecuteStoreQuery<MeterSearchList>("exec [SYCOUS].[GetMeterSearchDetails] @PropertyID,@MeterID", pPropertyID, pMeterID).FirstOrDefault();
             return List;
         }
         catch (Exception ex)
         {
             context.Dispose();
             throw;
         }
     }
 }
        public ActionResult GetMeterView(String PropID, String MeterID)
        {
            if (Session["Login"] != null)
            {
                LoginSession loginsession = (LoginSession)Session["Login"];
                ViewBag.CompanyLogo = loginsession.CompanyLogo;
                String actionName = this.ControllerContext.RouteData.Values["action"].ToString();
                String controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                ViewBag.Menu = BAL.Common.GetActiveMenu(controllerName, BAL.Common.LayoutType(loginsession.UserType));
                DAL.MeterSearchList Vwobj = new DAL.MeterSearchList();
                if (MeterID != null)
                {

                    String _PropID = BAL.Security.URLDecrypt(PropID);
                    String _MeterID = BAL.Security.URLDecrypt(MeterID);
                    if ((_MeterID != "0") && (_MeterID != null))
                    {
                        Vwobj = BAL.SearchModel.ViewMeter(_PropID, _MeterID);
                        ViewBag.PreviousConsumption = BAL.SearchModel.PreviousMeterReadingList(Vwobj.DeviceID != null ? Vwobj.DeviceID.ToString() : "0"
                            , Vwobj.SerialNumber != null ? Vwobj.SerialNumber.ToString() : "0");

                    }
                    return View(Vwobj);
                }
                else
                {
                    ViewBag.Meter = "";
                    return RedirectToAction("Index", "Search");
                }
            }
            else
            { return RedirectToAction("Index", "Home"); }
        }
        public ActionResult GetMeterDetails(String consID, String OwnerID, String PropID, String SiteID, String ClientID, String MeterID)
        {
            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, BAL.Common.LayoutType(loginsession.UserType));
                DAL.MeterSearchList Vwobj = new DAL.MeterSearchList();
                if (PropID != null)
                {

                    String DPropID = BAL.Security.URLDecrypt(PropID);
                    String _MeterID = BAL.Security.URLDecrypt(MeterID);
                    if ((DPropID != "0") && (DPropID != null) )
                    {
                        Vwobj = BAL.SearchModel.ViewMeter(DPropID, _MeterID);
                        if (Vwobj != null)
                        {
                            ViewBag.PreviousConsumption = BAL.SearchModel.PreviousMeterReadingList(Vwobj.DeviceID != null ? Vwobj.DeviceID.ToString() : "0"
                                , Vwobj.SerialNumber != null ? Vwobj.SerialNumber.ToString() : "0");

                            ViewBag.Meter = new SelectList(BAL.SearchModel.MeterSupplierDropDownList(DPropID), "Value", "Text", Vwobj.MeterID);
                            ViewBag.Property = Vwobj.PropertyID;
                        }
                        else
                        {
                            ViewBag.PreviousConsumption = null;
                            ViewBag.Meter = new SelectList(BAL.SearchModel.MeterSupplierDropDownList(DPropID), "Value", "Text");
                            ViewBag.Property = DPropID;
                        }

                    }

                    else
                    {

                        ViewBag.PreviousConsumption = null;
                        ViewBag.Meter = new SelectList(BAL.SearchModel.MeterSupplierDropDownList(DPropID), "Value", "Text");
                        ViewBag.Property = DPropID;
                    }

                    return View(Vwobj);
                }
                else
                {
                    ViewBag.Meter = "";
                    return RedirectToAction("Index", "Search");
                }
            }
            else
            { return RedirectToAction("Index", "Home"); }
        }