Пример #1
0
        public ActionResult GetAccessByLoginSys(string filial, string login, decimal interval)
        {
            var radiusClient = new RadiusAsync.radius2Client("http");

            RadiusAsync.Get_Access_by_Login_SysResult  theAccessSysResult;
            RadiusAsync.Get_Access_by_Login_SysRequest theAccessSysRequest = new RadiusAsync.Get_Access_by_Login_SysRequest();
            theAccessSysRequest.Command = new MetaCommand()
            {
                Operation = DbOperation.ExecuteQuery
            };
            theAccessSysRequest.Connection = new MetaConnection()
            {
                Connection = "*.*"
            };
            theAccessSysRequest.Parameters = new Get_Access_by_Login_SysInputParameters()
            {
                p_Interval = interval,
                p_Login    = login,
                p_Filial   = filial
            };
            theAccessSysResult = radiusClient.Get_Access_by_Login_Sys(theAccessSysRequest);
            ViewBag.ResultSet  = theAccessSysResult.ResultSet;

            return(View());
        }
Пример #2
0
        public ActionResult GetAccessByLogin(string filial, string login, string datebgn, string dateend, int interval)
        {
            var radiusClient = new RadiusAsync.radius2Client("http");

            DateTime dbgn;
            DateTime dend;

            if (interval > 0)
            {
                dbgn = DateTime.Now.AddMinutes(-1 * interval);
                dend = DateTime.Now;

                RadiusAsync.Get_Access_by_Login_SysResult theLoginSysResult;
                theLoginSysResult = radiusClient.Get_Access_by_Login_Sys(new Get_Access_by_Login_SysRequest()
                {
                    Command = new MetaCommand()
                    {
                        Operation = DbOperation.ExecuteQuery
                    },
                    Connection = new MetaConnection()
                    {
                        Connection = "*.*"
                    },
                    Parameters = new Get_Access_by_Login_SysInputParameters()
                    {
                        p_Filial   = filial,
                        p_Login    = login,
                        p_Interval = interval
                    }
                });
                ViewBag.ResultSet = theLoginSysResult.ResultSet;
            }
            else
            {
                dbgn = DateTime.ParseExact(datebgn + " 00:00:00", "dd.MM.yyyy H:mm:ss", new CultureInfo("en-US"));
                dend = DateTime.ParseExact(dateend + " 23:59:59", "dd.MM.yyyy H:mm:ss", new CultureInfo("en-US"));
            }

            RadiusAsync.Get_Access_by_LoginResult theLoginResult;
            theLoginResult = radiusClient.Get_Access_by_Login(new Get_Access_by_LoginRequest()
            {
                Command = new MetaCommand()
                {
                    Operation = DbOperation.ExecuteQuery
                },
                Connection = new MetaConnection()
                {
                    Connection = "*.*"
                },
                Parameters =//параметры функции
                             new Get_Access_by_LoginInputParameters()
                {
                    p_Date_Beg = dbgn,
                    p_Date_End = dend,
                    p_Login    = login,
                    p_Filial   = filial
                }
            });
            ViewBag.ResultSet = theLoginResult.ResultSet;

            return(View());
        }