public ActionResult Index()
        {
            base.SetDisplayBtn();
            base.SetCreateBtn();
            base.SetEditBtn();
            base.SetDeleteBtn();

            var model = new PROD_PROMOTIONSModel();

            return(View(model));
        }
        public ActionResult Display(string ID)
        {
            var model  = new PROD_PROMOTIONSModel();
            var entity = PROD_PROMOTIONSService.PROD_PROMOTIONSList.FirstOrDefault(t => t.ID == ID);

            if (null != entity)
            {
                model = new PROD_PROMOTIONSModel
                {
                    ID = entity.ID, ProductNo = entity.ProductNo, Title = entity.Title, ImgFile = entity.ImgFile, Description = entity.Description, FootNote = entity.FootNote, SortNo = entity.SortNo, CreateDate = entity.CreateDate, Status = entity.Status
                };
            }
            return(View(model));
        }
Пример #3
0
        public OperationResult Insert(PROD_PROMOTIONSModel model)
        {
            var entity = new PROD_PROMOTIONS
            {
                ID          = model.ID,
                ProductNo   = model.ProductNo,
                Title       = model.Title,
                ImgFile     = model.ImgFile,
                Description = model.Description,
                FootNote    = model.FootNote,
                SortNo      = model.SortNo,
                CreateDate  = model.CreateDate,
                Status      = model.Status,
            };

            PROD_PROMOTIONSRepository.Insert(entity);
            return(new OperationResult(OperationResultType.Success, "Added successfully"));
        }
 public ActionResult Create(PROD_PROMOTIONSModel model)
 {
     if (ModelState.IsValid)
     {
         this.CreateBaseData <PROD_PROMOTIONSModel>(model);
         OperationResult result = PROD_PROMOTIONSService.Insert(model);
         if (result.ResultType == OperationResultType.Success)
         {
             return(Json(result));
         }
         else
         {
             return(PartialView(model));
         }
     }
     else
     {
         return(PartialView(model));
     }
 }
        public ActionResult Create()
        {
            var model = new PROD_PROMOTIONSModel();

            return(PartialView(model));
        }