Пример #1
0
        //public ActionResult comment()
        //{

        //    string device = RandomString(10);
        //    string code = MD5Hash(device + "ncase8934f49909");
        //    string result = "";
        //    using (WebClient client = new WebClient())
        //    {

        //        var collection = new NameValueCollection();
        //        collection.Add("device", device);
        //        collection.Add("code", code);
        //        collection.Add("servername", servername);
        //        //collection.Add("DayOfWeek", DayOfWeek);
        //        //collection.Add("TimeFrom", TimeFrom);
        //        //collection.Add("TimeTo", TimeTo);
        //        byte[] response =
        //        client.UploadValues(ConfigurationManager.AppSettings["server"] + "/Admin/GetComments.php?", collection);

        //        result = System.Text.Encoding.UTF8.GetString(response);
        //    }

        //    ViewModel.Comments log = JsonConvert.DeserializeObject<asb.ViewModel.Comments>(result);
        //    return View(log);
        //}
        //public void setAdminComment(string id, string comment)
        //{
        //    string result = "";
        //    string device = RandomString(10);
        //    string code = MD5Hash(device + "ncase8934f49909");
        //    using (WebClient client = new WebClient())
        //    {

        //        var collection = new NameValueCollection();
        //        collection.Add("servername", servername);
        //        collection.Add("device", device);
        //        collection.Add("code", code);
        //        collection.Add("id", id);
        //        collection.Add("comment", comment);

        //        byte[] response =
        //        client.UploadValues(ConfigurationManager.AppSettings["server"] + "/Admin/setAdminComment.php?", collection);

        //        result = System.Text.Encoding.UTF8.GetString(response);
        //    }
        //}
        //public void delCommnet(string id)
        //{
        //    string result = "";
        //    string device = RandomString(10);
        //    string code = MD5Hash(device + "ncase8934f49909");
        //    using (WebClient client = new WebClient())
        //    {

        //        var collection = new NameValueCollection();
        //        collection.Add("servername", servername);
        //        collection.Add("device", device);
        //        collection.Add("code", code);
        //        collection.Add("id", id);


        //        byte[] response =
        //        client.UploadValues(ConfigurationManager.AppSettings["server"] + "/Admin/delComment.php?", collection);

        //        result = System.Text.Encoding.UTF8.GetString(response);
        //    }
        //}
        //public void changeCommnetActive(string id, string value)
        //{
        //    string result = "";
        //    string device = RandomString(10);
        //    string code = MD5Hash(device + "ncase8934f49909");
        //    using (WebClient client = new WebClient())
        //    {

        //        var collection = new NameValueCollection();
        //        collection.Add("servername", servername);
        //        collection.Add("device", device);
        //        collection.Add("code", code);
        //        collection.Add("id", id);
        //        collection.Add("value", value);

        //        byte[] response =
        //        client.UploadValues(ConfigurationManager.AppSettings["server"] + "/Admin/ChangeCommentStatus.php?", collection);

        //        result = System.Text.Encoding.UTF8.GetString(response);
        //    }
        //}

        #endregion



        #region MediaDownload
        public ActionResult Media(string message)
        {
            //if (Session["LogedInUser2"] == null)
            //{

            //    return RedirectToAction("Index", "Admin");

            //}

            if (message == "1")
            {
                ViewBag.mess = "1";
            }

            List <vmedia> medialist = manager.getMediaList().Select(i => new vmedia
            {
                ID    = i.ID,
                title = i.title,
                type  = i.MediaType.title,
            }).ToList();
            List <string> typeList = new List <string>();

            foreach (var item in manager.getMediaTypeList().ToList())
            {
                typeList.Add(item.title);
            }

            manager.addUser(new user
            {
                fullname = "مهرداد منصوری",
                phone    = "09194594505",
                email    = "*****@*****.**"
            });

            List <string> userList = new List <string>();

            foreach (var item in manager.getUsers().ToList())
            {
                userList.Add(item.fullname);
            }


            mediaVM model = new mediaVM()
            {
                mediaList = medialist,
                typeList  = typeList,
                userList  = userList
            };

            return(View(model));
        }
Пример #2
0
        public ActionResult GetUserImageList(string username)
        {
            List <vmedia> usermedia = manager.getUserMediaList(manager.getUserID(username)).Select(i => new vmedia()
            {
                title = i.title,
                ID    = i.ID,
            }).ToList();
            mediaVM model = new mediaVM()
            {
                mediaList = usermedia,
            };

            return(PartialView("/Views/Shared/admin/_UpdateUserImage.cshtml", model));
        }