Exemple #1
0
        public static MeterList ViewMeterRecord(String MeterID)
        {
            MeterList objmeter = new MeterList();
            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 parMeter = new SqlParameter
                    {
                        ParameterName = "MeterID",
                        Value = MeterID,
                        Direction = ParameterDirection.Input
                    };
                    objmeter = context.ExecuteStoreQuery<MeterList>("exec SYCOUS.MeterList @mode,@Field,@FieldValue ,@MeterID", parmode,parField,parFieldValue, parMeter).FirstOrDefault();
                }
                catch (Exception ex)
                {
                    context.Dispose();
                    throw;
                }
            }
            return objmeter;
        }
 public ActionResult MView(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, actionName, BAL.Common.LayoutType(loginsession.UserType));
         ViewBag.RoleName = loginsession.RoleName;
         if (MeterID != null)
         {
             String DecMeterID = BAL.Security.URLDecrypt(MeterID);
             DAL.MeterList meter = new DAL.MeterList();
             if ((DecMeterID != "0") && (DecMeterID != null))
             {
                 meter = BAL.MeterModel.ViewMeter(DecMeterID);
                 ViewBag.MeterID = meter.ID;
             }
             return View(meter);
         }
         else
         { return RedirectToAction("Index", "Meter"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }
Exemple #3
0
 public Object ViewRecord(Int64 MeterID)
 {
     MeterList vwMeter = new MeterList();
     try
     {
         vwMeter = DAL.DALMeter.ViewMeterRecord(MeterID.ToString());
     }
     catch (Exception ex)
     {
         throw;
     }
     return vwMeter;
 }
 public ActionResult ConsumerView(String MeterID)
 {
     if (Session["Login"] != null)
     {
         LoginSession loginsession = (LoginSession)Session["Login"];
         ViewBag.CompanyLogo = loginsession.CompanyLogo;
         if (MeterID != null)
         {
             String DecMeterID = BAL.Security.URLDecrypt(MeterID);
             DAL.MeterList meter = new DAL.MeterList();
             if ((DecMeterID != "0") && (DecMeterID != null))
             {
                 meter = BAL.MeterModel.ViewMeter(DecMeterID);
                 ViewBag.MeterID = meter.ID;
             }
             return View(meter);
         }
         else
         { return RedirectToAction("ConsumerIndex", "Meter"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }