示例#1
0
        public ActionResult Op_delete_edit(string action, int id, string Key = "", string value = "")
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                if (action == "edit")
                {
                    if (Key != "" && value != "")
                    {
                        db.Script("UPDATE[tbl_Product_tblOptions] SET [KeyName] = N'" + Key + "',[Value] = N'" + value + "' WHERE id_Op=" + id);
                    }
                }
                else if (action == "delete")
                {
                    db.Script("DELETE FROM[tbl_Product_tblOptions] WHERE id_Op=" + id);
                }
                else if (action == "new")
                {
                    if (Key != "" && value != "")
                    {
                        db.Script("INSERT INTO[tbl_Product_tblOptions]VALUES(" + id + ",N'" + Key + "',N'" + value + "')");
                    }
                }


                return(Content("done"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
        public ActionResult Add_Edit_Post(string ActTodo, int WrittenBy_AdminId, string Title, string Text_min, string Text, int weight, int Cat_Id, int IsImportant, int GroupId, string Pictures, string Blog_Tags, int TypeId, int id_pr = 0)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                Blog_ModelFiller BMF = new Blog_ModelFiller();

                return(Content(BMF.Post_Action(ActTodo, WrittenBy_AdminId, Title, Text_min, Text, weight, Cat_Id, IsImportant, GroupId, Pictures, Blog_Tags, TypeId, id_pr)));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#3
0
        public ActionResult Product_Actions(string ActToDo, int id)
        {
            string SSSession = ""; CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                if (ActToDo == "Delete")
                {
                    db.Script("UPDATE [tbl_Product] SET [ISDELETE] = 1 WHERE id_MProduct=" + id);
                }
                else if (ActToDo == "Active")
                {
                    db.Script("UPDATE [tbl_Product] SET [IS_AVAILABEL] = 1 WHERE id_MProduct=" + id);
                }
                else if (ActToDo == "DeActive")
                {
                    db.Script("UPDATE [tbl_Product] SET [IS_AVAILABEL] = 0 WHERE id_MProduct=" + id);
                }
                return(Content("Success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
        public ActionResult PostTable()
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            } CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                Blog_ModelFiller BMF = new Blog_ModelFiller();
                return(View(BMF.Posttable()));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
        public ActionResult Add_Update_Tags(string ActToDo, string T_Name, int CatId, int id = 0)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                Blog_ModelFiller BMF = new Blog_ModelFiller();
                // var model = BMF.B_Tags_Filler(CatId);
                return(Content(BMF.Add_Update_Tag(ActToDo, T_Name, CatId, id)));
                //return Content("hello");
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#6
0
        public IHttpActionResult PostDialogList(DialogList dialogList)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            CookieHeaderValue cookie = Request.Headers.GetCookies("UserSession").FirstOrDefault();

            if (!CheckAccess.IsAccess(cookie, dialogList.firstUserId, "User") && !CheckAccess.IsAccess(cookie, dialogList.secondUserId, "User"))
            {
                return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.Forbidden)));
            }

            if (db.DialogLists.FirstOrDefault(x => x.firstUserId == dialogList.firstUserId &&
                                              x.secondUserId == dialogList.secondUserId) == null)     //создаем новый диалог в списке если до этого он не был создан
            {
                db.DialogLists.Add(dialogList);
                db.SaveChanges();
            }
            else
            {
                return(BadRequest(ModelState));
            }

            return(CreatedAtRoute("DefaultApi", new { id = dialogList.id }, dialogList));
        }
示例#7
0
        public ActionResult Add_Page4(int SubId)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                ModelFiller MF = new ModelFiller();

                AddProductModelV_4 model = new AddProductModelV_4()
                {
                    MainTags      = MF.MainTagsModel_Filler(),
                    OffTypes      = MF.OffTypeModel_Filler(),
                    PriceShow     = MF.PriceShowModel_Filler(),
                    PriceType     = MF.MoneyTypeModel_Filler(),
                    QuantityTypes = MF.PQTModel_Filler(),
                    Tags          = MF.TagsModel_Filler(SubId)
                };

                return(View(model));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#8
0
        public ActionResult NotAccess()
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess == true)
            {
                return(View());
            }
            else
            {
                return(RedirectToAction("LoginAuth"));
            }
        }
        public IHttpActionResult GetFriendList(int id, int page)
        {
            CookieHeaderValue cookie = Request.Headers.GetCookies("UserSession").FirstOrDefault();

            if (!CheckAccess.IsAccess(cookie, id, "User"))
            {
                return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.Forbidden)));
            }

            List <FriendList> fullFavoriteList = db.Friends.Where(x => x.who == id).ToList();

            int startNum = (page - 1) * 12;
            List <FriendList> friendList = fullFavoriteList.OrderBy(x => x.id).Skip(startNum).Take(12).ToList();//db.Friends.Where(x => x.who == id).OrderBy(x => x.id).Skip(0).Take(12).ToList();

            if (friendList == null)
            {
                return(NotFound());
            }
            List <int> usersId = new List <int>();

            for (int i = 0; i < friendList.Count; i++)
            {
                usersId.Add(friendList[i].with);
            }

            return(Ok(SelectionWithId(usersId.ToArray(), fullFavoriteList)));
        }
示例#10
0
        public ActionResult Add_Update_MainTag(string ActToDo, string Cat_Name, string Discription, int id = 0)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                ProductGroup_ModelFiller MF = new ProductGroup_ModelFiller();
                return(Content(MF.Add_Update_MainTags(ActToDo, Cat_Name, Discription, id)));
            }
            else
            {
                return(Content("NotAccess"));
            }
        }
示例#11
0
        public ActionResult MainTag_Add_Update(string ActTodo, string Name, string Description, int id = 0)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();

                if (ActTodo == "insert")
                {
                    db.Script("INSERT INTO [tbl_Product_MainStarTags]VALUES(N'" + Description + "',N'" + Name + "')");
                }
                else if (ActTodo == "update")
                {
                    db.Script("UPDATE [tbl_Product_MainStarTags] SET [MST_Description] =N'" + Description + "' ,[MST_Name] =N'" + Name + "' WHERE id_MainStarTag=" + id);
                }
                else if (ActTodo == "delete")
                {
                    db.Script("DELETE FROM [tbl_Product_MainStarTags]WHERE id_MainStarTag=" + id);
                }

                return(Content("Success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#12
0
        public ActionResult ProductSaleList(string Gp = "همه", int Id = 0)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                ModelFiller MF = new ModelFiller();
                return(View(MF.Pro_SaleList(Gp, Id)));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#13
0
        public ActionResult MainTagsTbl()
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                ProductGroup_ModelFiller MF = new ProductGroup_ModelFiller();
                return(View(MF.MainTagsTbl()));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#14
0
        public ActionResult FactorView(int Id)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                ModelFiller MF = new ModelFiller();
                return(View(MF.FactorDetailePage(Id)));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#15
0
        public ActionResult Tag_Add_Update(string ActTodo, int SubId, string Name, int id = 0)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();

                if (ActTodo == "insert")
                {
                    db.Script("INSERT INTO [tbl_Product_TagEnums]VALUES (N'" + Name + "'," + SubId + ")");
                }
                else if (ActTodo == "update")
                {
                    db.Script("UPDATE [tbl_Product_TagEnums] SET [TE_name] = N'' WHERE id_TE=" + id);
                }
                else if (ActTodo == "delete")
                {
                    db.Script("DELETE FROM [tbl_Product_tagConnector] WHERE id_TE=" + id);
                    db.Script("DELETE FROM [tbl_Product_TagEnums] WHERE id_TE=" + id);
                }

                return(Content("Success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#16
0
        public ActionResult Save_Step5(string ActTodo, int id)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();

                if (ActTodo == "delete")
                {
                    db.Script("UPDATE [tlb_Product_MainProductConnector] SET [ISDELETE] = 1 WHERE id_MPC=" + id);
                }
                else if (ActTodo == "restore")
                {
                    db.Script("UPDATE [tlb_Product_MainProductConnector] SET [ISDELETE] = 0 WHERE id_MPC=" + id);
                }


                return(Content("success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#17
0
        public ActionResult TagFiller(int CatId)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                Blog_ModelFiller BMF = new Blog_ModelFiller();
                var model            = BMF.B_Tags_Filler(CatId);
                return(Json(model));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
        public IHttpActionResult PutAvatar([FromBody] int siteUserId)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            CookieHeaderValue cookie = Request.Headers.GetCookies("UserSession").FirstOrDefault();

            if (!CheckAccess.IsAccess(cookie, siteUserId, "Moder"))
            {
                return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.Forbidden)));
            }

            Avatar oldAvatar = db.Avatars.FirstOrDefault(x => x.siteUserId == siteUserId &&
                                                         x.confirmState == "PrevAva");

            if (oldAvatar != null)
            {
                db.Avatars.Remove(oldAvatar);
                File.Delete(oldAvatar.base64);
            }

            Avatar NewAva = db.Avatars.FirstOrDefault(x => x.siteUserId == siteUserId &&
                                                      x.confirmState == "Waiting");         //Если пользователь изменил мнение и решил изменить отправленный, но еще не подтвержденный аватар

            //FileInfo fileInfo = new FileInfo(NewAva.base64);
            //System.IO.File.Move(fileInfo.FullName, fileInfo.DirectoryName + "//Confirmed.jpg");

            NewAva.confirmState    = "Confirmed";
            db.Entry(NewAva).State = EntityState.Modified;
            db.SaveChanges();

            return(Ok(NewAva));
        }
示例#19
0
        public ActionResult Type_Actions(string ActToDo, int id)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                if (ActToDo == "Delete")
                {
                    db.Script("UPDATE [tbl_Product_Type] SET [ISDelete] = 1 ,[DateDeleted] = GETDATE() WHERE id_PT = " + id);
                    db.Script("UPDATE [tbl_Product]SET[ISDELETE] = 1 WHERE [id_Type]=" + id);
                    db.Script("UPDATE P SET P.ISDelete=1,P.DateDeleted= GETDATE() FROM[tbl_Product_SubCategory] AS P inner Join [tbl_Product_MainCategory] As M On P.id_MC=M.id_MC where M.id_PT=" + id);
                    db.Script("UPDATE [tbl_Product_MainCategory] SET ISDelete = 1 , DateDeleted= GETDATE() WHERE id_PT=" + id);
                    db.Script("UPDATE R SET R.ISDelete=1,R.DateDeleted= GETDATE() FROM[tbl_Product_SubCategoryOptionKey]AS R inner Join [tbl_Product_SubCategory] AS P On R.id_SC=P.id_SC inner Join [tbl_Product_MainCategory] As M On P.id_MC=M.id_MC where M.id_PT=" + id);
                }
                else if (ActToDo == "DeActive")
                {
                    db.Script("UPDATE[tbl_Product_Type] SET [ISDESABLED] = 1 ,[DateDesabled] = GETDATE()  WHERE id_PT = " + id);
                    db.Script("UPDATE [tbl_Product]SET[IS_AVAILABEL] = 0 WHERE [id_Type]=" + id);
                    db.Script("UPDATE P SET P.ISDESABLED=1,P.DateDesabled= GETDATE() FROM[tbl_Product_SubCategory] AS P inner Join [tbl_Product_MainCategory] As M On P.id_MC=M.id_MC where M.id_PT=" + id);
                    db.Script("UPDATE [tbl_Product_MainCategory] SET ISDESABLED = 1 , DateDesabled= GETDATE() WHERE id_PT=" + id);
                    db.Script("UPDATE R SET R.ISDESABLED=1,R.DateDesabled= GETDATE() FROM[tbl_Product_SubCategoryOptionKey]AS R inner Join [tbl_Product_SubCategory] AS P On R.id_SC=P.id_SC inner Join [tbl_Product_MainCategory] As M On P.id_MC=M.id_MC where M.id_PT=" + id);
                }
                else if (ActToDo == "Active")
                {
                    db.Script("UPDATE[tbl_Product_Type] SET [ISDESABLED] = 0 ,[DateDesabled] = GETDATE() WHERE id_PT =" + id);
                    db.Script("UPDATE [tbl_Product]SET[IS_AVAILABEL] = 1 WHERE [id_Type]=" + id);
                    db.Script("UPDATE P SET P.ISDESABLED=0 FROM[tbl_Product_SubCategory] AS P inner Join [tbl_Product_MainCategory] As M On P.id_MC=M.id_MC where M.id_PT=" + id);
                    db.Script("UPDATE [tbl_Product_MainCategory] SET ISDESABLED = 0 WHERE id_PT=" + id);
                    db.Script("UPDATE R SET R.ISDESABLED=0 FROM[tbl_Product_SubCategoryOptionKey]AS R inner Join [tbl_Product_SubCategory] AS P On R.id_SC=P.id_SC inner Join [tbl_Product_MainCategory] As M On P.id_MC=M.id_MC where M.id_PT=" + id);
                }
                db.DC();
                return(Content("Success"));
            }
            else
            {
                return(Content("NotAccess"));
            }
        }
示例#20
0
        public ActionResult Opinion_show()
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                using (DataTable dt = db.Select("SELECT [id_MProduct],[id_Customer],[id_AccByAdmin],[CreateDate],[DateAccepted],[Is_Accepted],[OpinionDescription],[Rate],[ISDELETE],[id_Opinion] FROM [dbo].[tbl_Product_Opinion]"))
                {
                    db.DC();
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        data_op = new opinion();
                        string str = dt.Rows[i]["ISDELETE"].ToString();
                        if (dt.Rows[i]["ISDELETE"].ToString() == "0")
                        {
                            data_op.id_Opinion         = dt.Rows[i]["id_Opinion"].ToString();
                            data_op.id_MProduct        = dt.Rows[i]["id_MProduct"].ToString();
                            data_op.id_Customer        = dt.Rows[i]["id_Customer"].ToString();
                            data_op.CreateDate         = dt.Rows[i]["CreateDate"].ToString();
                            data_op.Is_Accepted        = dt.Rows[i]["Is_Accepted"].ToString();
                            data_op.OpinionDescription = dt.Rows[i]["OpinionDescription"].ToString();
                            data_op.Rate = dt.Rows[i]["Rate"].ToString();
                            list_op.Add(data_op);
                        }
                    }
                    ViewBag.opin = list_op;
                };


                return(View());
            }
            else
            {
                return(RedirectToAction("NotAccess"));
            }
        }
示例#21
0
        public IHttpActionResult GetDialogList(int id)
        {
            CookieHeaderValue cookie = Request.Headers.GetCookies("UserSession").FirstOrDefault();

            if (!CheckAccess.IsAccess(cookie, id, "User"))
            {
                return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.Forbidden)));
            }

            /*
             *          List<Dialog> dialogList = db.Dialogs.Where(x => x.from == id || x.to == id).Distinct().ToList();
             * if (dialogList == null)
             * {
             *  return NotFound();
             * }
             * List<int> usersId = new List<int>();
             * for (int i = 0; i < dialogList.Count; i++)
             * {
             *  int userId;
             *  if (dialogList[i].to != id && !usersId.Contains(dialogList[i].to) && !usersId.Contains(dialogList[i].from))
             *      userId = dialogList[i].to;
             *  else
             *      userId = dialogList[i].from;
             *
             *  usersId.Add(userId);
             * }
             */
            List <DialogList> dialogList = db.DialogLists.Where(x => x.firstUserId == id || x.secondUserId == id).ToList();

            if (dialogList == null)
            {
                return(NotFound());
            }

            List <int> usersId = new List <int>();

            for (int i = 0; i < dialogList.Count; i++)
            {
                int userId;
                if (dialogList[i].firstUserId != id && !usersId.Contains(dialogList[i].firstUserId) && !usersId.Contains(dialogList[i].secondUserId))
                {
                    userId = dialogList[i].firstUserId;
                }
                else
                {
                    userId = dialogList[i].secondUserId;
                }

                usersId.Add(userId);
            }

            return(Ok(LikeListsController.SelectionWithId(usersId.ToArray())));
        }
示例#22
0
        public ActionResult Add_Page1()
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                return(View());
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#23
0
        public ActionResult MainDropDown(string drop, int id = 0)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                return(View());
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#24
0
        public ActionResult GetImageInformation(string IDReqPic)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                return(Content("salam2"));
            }
            else
            {
                return(Content(""));
            }
        }
示例#25
0
        public IHttpActionResult GetGuestList(int id)
        {
            CookieHeaderValue cookie = Request.Headers.GetCookies("UserSession").FirstOrDefault();

            if (!CheckAccess.IsAccess(cookie, id, "User"))
            {
                return(ResponseMessage(new HttpResponseMessage(HttpStatusCode.Forbidden)));
            }

            List <GuestList> guests = db.Guests.Where(x => x.to == id).ToList();

            return(Ok(guests.ToArray()));
        }
示例#26
0
        // GET: BlogAPI_Designer
        public ActionResult Index()
        {
            string SSSession = ""; CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                return(View());
            }
            else
            {
                return(Content("No Access"));
            }
        }
示例#27
0
        public ActionResult NewBlogPost()
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            } CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                //ControllerContext.ParentActionViewContext.ViewBag.PageTitle = "";
                Blog_ModelFiller BMF = new Blog_ModelFiller();
                var Model            = new Blog_Post_insert_Model()
                {
                    Category = BMF.BCategory_Filler(),
                    Groups   = BMF.Groups_Filler(),
                    Type     = BMF.B_Types_Filler(),
                    PostData = new PostModel()
                    {
                        Id        = 0,
                        AdminPic  = "",
                        Category  = "",
                        ImagePath = "",
                        InGroup   = "",
                        title     = "",
                        text_min  = "",
                        text      = "",
                        tags      = "", date = "", by = "", Tags = new List <string>(), Comments__ = 0, IsDeleted = 0, IsDisabled = 0, IsImportant = 0, SearchGravity = 0
                    }
                };



                return(View(Model));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#28
0
        public ActionResult UploadEditorResultActions(string IDToEdit, string picname, string picdesc, string picWords)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                List <ExcParameters> EXpars = new List <ExcParameters>();
                ExcParameters        par    = new ExcParameters()
                {
                    _KEY   = "@PicID",
                    _VALUE = IDToEdit
                };
                EXpars.Add(par);
                par = new ExcParameters()
                {
                    _KEY   = "@alt",
                    _VALUE = picdesc
                };
                EXpars.Add(par);
                par = new ExcParameters()
                {
                    _KEY   = "@uploadPicName",
                    _VALUE = picname
                };
                EXpars.Add(par);
                par = new ExcParameters()
                {
                    _KEY   = "@Descriptions",
                    _VALUE = picWords
                };
                EXpars.Add(par);
                string updateRes =
                    db.Script(
                        "UPDATE [tbl_ADMIN_UploaderStructure] SET  [alt] = @alt  ,[uploadPicName] = @uploadPicName  ,[Descriptions] = @Descriptions WHERE [PicID] = @PicID", EXpars);
                if (updateRes == "1")
                {
                    //{"name":"1","id":"1"}
                    return(Content("{\"Res\":\"1\"}"));
                }
                else
                {
                    return(Content("{\"Res\":\"-2\"}"));
                }
            }
            else
            {
                return(Content("{\"Res\":\"-1\"}"));
            }
        }
示例#29
0
        public ActionResult Save_Step2(string Type, string Main, string Sub, string SubKey, int id)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                ModelFiller MF = new ModelFiller();
                return(Content(MF.Product_Action_Step2(Type, Main, Sub, SubKey, id)));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
示例#30
0
        public ActionResult loadGallery()
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                ImageGalleryModels model = new ImageGalleryModels();
                model.models = new List <ImageGalleryModel>();
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                using (DataTable dt =
                           db.Select(
                               "SELECT [PicID] ,[PicAddress] ,[alt] ,[uploadPicName]  ,[Descriptions] FROM [v_Images] WHERE [ISDELETE]=0")
                       )
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        ImageGalleryModel images = new ImageGalleryModel();
                        images.id = dt.Rows[i]["PicID"].ToString();
                        images.imageAddress(dt.Rows[i]["PicAddress"].ToString());
                        images.Description = dt.Rows[i]["Descriptions"].ToString();
                        images.label       = dt.Rows[i]["alt"].ToString();
                        images.ImageName   = dt.Rows[i]["uploadPicName"].ToString();
                        try
                        {
                            int _l = 0;
                            if (Int32.TryParse(dt.Rows[i]["id_MProduct"].ToString(), out _l))
                            {
                                images.check = 1;
                            }
                            else
                            {
                                images.check = 0;
                            }
                        }
                        catch
                        {
                            images.check = 0;
                        }
                        model.models.Add(images);
                    }
                }
                return(View(model));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
            CheckAccess accessCheckObj;
			bool hasAccess = false;
			accessCheckObj = new CheckAccess();
			//Get user Token
			HandleRef token = new HandleRef(this, ((HttpWorkerRequest)((IServiceProvider)Context).GetService(typeof(HttpWorkerRequest))).GetUserToken());
            // This code will check the access permission for the logged in user for Modifying Employee Information
			try
			{
	    		hasAccess = accessCheckObj.CheckAccessPermissions(token
    								, Resources.Operations.ModifyEmployeeInformation.ToString()
									, AccessCheck.ScopeName.GENERAL
									, Convert.ToInt32(Resources.Operations.ModifyEmployeeInformationID.ToString()));
                // if has Access is true then the user has the permission to proceed and perform the operation 
                // else he/she should be redirected to the access denied page 
			}
            catch (Exception ex)
			{
				// Handle Exception
			}
    }