Exemplo n.º 1
0
        public ActionResult SaveCMS(SA_CMS UserCMS)
        {
            for (int i = 0; i < Request.Files.Count; i++)
            {
                var file = Request.Files[i];

                if (file != null && file.ContentLength > 0)
                {
                    var fileName = Path.GetFileName(file.FileName);

                    var path = Path.Combine(Server.MapPath("~/ProductImages"), fileName);
                    file.SaveAs(path);
                    UserCMS.CMSImg = fileName;
                }
            }
            UserCMS.CreatedTime = DateTime.Now;
            CMSDataStore Obj = new CMSDataStore();

            if (UserCMS.id == 0)
            {
                Obj.AddCMS(UserCMS);
            }
            else
            {
                Obj.EditCMS(UserCMS);
            }
            return(RedirectToAction("CMS"));
        }
Exemplo n.º 2
0
        public JsonResult CMSList()
        {
            CMSDataStore  Obj     = new CMSDataStore();
            List <SA_CMS> CMSList = Obj.GetCMSList();

            return(Json(new { data = CMSList }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        //CMS Management
        public ActionResult CMS()
        {
            CMSDataStore Obj = new CMSDataStore();

            //List<SA_CMS> CMSList = Obj.GetCMSList();
            return(View("CMS"));
        }
Exemplo n.º 4
0
        public ActionResult AddCMS()
        {
            CMSDataStore    ObjDal          = new CMSDataStore();
            SA_CMSViewModel objCatViewModel = new SA_CMSViewModel();

            objCatViewModel.ProductList = ObjDal.GetProductList();

            return(View("add-CMS", objCatViewModel));
        }
Exemplo n.º 5
0
        public ActionResult DeleteCMS(int id)
        {
            CMSDataStore Obj = new CMSDataStore();

            if (Obj.DeleteCMS(id) == true)
            {
                return(View("CMS"));
            }
            else
            {
                return(View("ErrorEventArgs"));
            }
        }
Exemplo n.º 6
0
        public ActionResult EditCMS(int id)
        {
            CMSDataStore          Obj         = new CMSDataStore();
            SA_CMS                obj         = Obj.GetCMSByid(id);
            List <SelectListItem> productList = Obj.GetProductList();
            SA_CMSViewModel       objSaCatV   = new SA_CMSViewModel();

            objSaCatV.id              = obj.id;
            objSaCatV.CMSName         = obj.CMSName;
            objSaCatV.CMSDiscription  = obj.CMSDiscription;
            objSaCatV.Meta            = obj.Meta;
            objSaCatV.MetaDiscription = obj.MetaDiscription;
            objSaCatV.ProductList     = productList;



            return(View("add-CMS", objSaCatV));
        }