示例#1
0
 public ActionResult DView(String PeerID)
 {
     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 (PeerID != null)
         {
             String DPeerID = BAL.Security.URLDecrypt(PeerID);
             PeerConsumerList peer = new PeerConsumerList();
             if ((DPeerID != "0") && (DPeerID != null))
             {
                 peer = BAL.PeerConsumerModel.PeerConsumerView(DPeerID);
             }
             return View(peer);
         }
         else
         { return RedirectToAction("Index", "Peer"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }
示例#2
0
 public Object ViewRecord(Int64 peerId)
 {
     DAL.PeerConsumerList Peer = new PeerConsumerList();
     try
     {
         Peer = DAL.DALPeer.PeerConsumerAveragesView(peerId.ToString());
     }
     catch (Exception ex)
     {
         throw;
     }
     return Peer;
 }
示例#3
0
        public static PeerConsumerList PeerConsumerAveragesView(String PeerID)
        {
            PeerConsumerList List = new PeerConsumerList();
            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 = PeerID,
                        Direction = ParameterDirection.Input
                    };
                    List = context.ExecuteStoreQuery<PeerConsumerList>("exec [SYCOUS].[GetPeerConsumerAverages] @mode,@Field,@FieldValue,@ID", parmode, pField, pFieldValue, pID).FirstOrDefault();
                    return List;
                }
                catch (Exception ex)
                {
                    context.Dispose();
                    throw;
                }
            }
        }