예제 #1
0
        private List <Request> GetAllRequest()
        {
            RequestMetod requestMetod = new RequestMetod();
            var          resList      = requestMetod.GetRequests();

            return(resList);
        }
예제 #2
0
        public ActionResult Sort(string order_by)
        {
            RequestMetod requestMetod = new RequestMetod();

            if (order_by != null)
            {
                var resList = requestMetod.SortRequests(order_by);
                return(View("Index", resList));
            }
            return(View("Index", requestMetod.GetRequests()));
        }
예제 #3
0
        public ActionResult RequestName(string name)
        {
            RequestMetod requestMetod = new RequestMetod();

            try
            {
                if (name != null)
                {
                    var resList = requestMetod.GetRequestNameInfo(name);
                    if (resList.Count != 0)
                    {
                        return(View("Index", resList));
                    }
                }
            }
            catch (Exception)
            {
                return(View("Index", requestMetod.GetRequests()));
            }
            return(View("Index", requestMetod.GetRequests()));
        }
예제 #4
0
        public ActionResult ClientInfo(string clientId)
        {
            RequestMetod requestMetod = new RequestMetod();

            try
            {
                if (clientId != null)
                {
                    var resList = requestMetod.GetClientInfo(clientId);
                    if (resList.Count != 0)
                    {
                        return(View("Index", resList));
                    }
                }
            }
            catch (Exception)
            {
                return(View("Index", requestMetod.GetRequests()));
            }
            return(View("Index", requestMetod.GetRequests()));
        }
예제 #5
0
        public ActionResult AddFile(HttpPostedFileBase upload)
        {
            RequestMetod requestMetod = new RequestMetod();

            try
            {
                string fileName = System.IO.Path.GetFileName(upload.FileName);
                upload.SaveAs(Server.MapPath("~/RequestFiles/" + fileName));
                bool res = requestMetod.CheckFileExtension(fileName);
                if (res)
                {
                    ViewBag.File = "Загружен";
                }
                var resList = GetAllRequest();
                return(View("Index", resList));
            }
            catch (Exception)
            {
                return(View("Index", requestMetod.GetRequests()));
            }
        }