Example #1
0
 public ActionResult DView(String FlowID)
 {
     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 (FlowID != null)
         {
             String DFlowID = BAL.Security.URLDecrypt(FlowID);
             FlowTemperaturesList flow = new FlowTemperaturesList();
             if ((DFlowID != "0") && (DFlowID != null))
             {
                 flow = BAL.FlowTemperaturesModel.FlowTemperaturesView(DFlowID);
             }
             return View(flow);
         }
         else
         { return RedirectToAction("Index", "Flow"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }
        public static FlowTemperaturesList FlowTemperaturesView(String DisConnectedID)
        {
            FlowTemperaturesList List = new FlowTemperaturesList();
            using (var context = new SycousCon())
            {
                try
                {
                    var parmode = new SqlParameter
                    {
                        ParameterName = "mode",
                        Value = 3,
                        Direction = ParameterDirection.Input
                    };

                    var pField = new SqlParameter
                    {
                        ParameterName = "Field",
                        Value = "",
                        Direction = ParameterDirection.Input
                    };
                    var pFieldValue = new SqlParameter
                    {
                        ParameterName = "FieldValue",
                        Value = "",
                        Direction = ParameterDirection.Input
                    };

                    var pID = new SqlParameter
                    {
                        ParameterName = "ID",
                        Value = DisConnectedID,
                        Direction = ParameterDirection.Input
                    };
                    List = context.ExecuteStoreQuery<FlowTemperaturesList>("exec [SYCOUS].[GetFlowTemperatures] @mode,@Field,@FieldValue,@ID", parmode, pField, pFieldValue, pID).FirstOrDefault();
                    return List;
                }
                catch (Exception ex)
                {
                    context.Dispose();
                    throw;
                }
            }
        }
 public Object ViewRecord(Int64 FlowId)
 {
     DAL.FlowTemperaturesList Flow = new FlowTemperaturesList();
     try
     {
         Flow = DAL.DALFlowTemperatures.FlowTemperaturesView(FlowId.ToString());
     }
     catch (Exception ex)
     {
         throw;
     }
     return Flow;
 }