Example #1
0
        public JsonResult Edit(StoreReportDto storereportdto)
        {
            ResultJsonInfo resultJsonInfo = new ResultJsonInfo()
            {
                Data = "", ErrorMsg = "", Success = true
            };

            if (storereportdto != null)
            {
                storereportdto.UpdateUser = ServiceHelper.GetCurrentUser().UserName;
                storereportdto.UpdateTime = DateTime.Now;
                if (!Service.Update(storereportdto))
                {
                    resultJsonInfo.Success  = false;
                    resultJsonInfo.ErrorMsg = "更新失敗";
                }
            }
            return(Json(new { resultJsonInfo }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public ActionResult Add(StoreReportDto storereportdto)
        {
            ResultJsonInfo resultJsonInfo = new ResultJsonInfo()
            {
                Data = "", ErrorMsg = "", Success = true
            };

            if (storereportdto != null)
            {
                storereportdto.CreateUser  = ServiceHelper.GetCurrentUser().UserName;
                storereportdto.CredateTime = DateTime.Now;
                if (!Service.Add(storereportdto))
                {
                    resultJsonInfo.Success  = false;
                    resultJsonInfo.ErrorMsg = "添加失敗";
                    return(Content("<script>alert('添加失敗');history.go(-1);</script>"));
                }
            }
            //return Content("<script>alert('添加成功');</script>");
            return(this.Ajax_JGClose());
        }
Example #3
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="goodsDto"></param>
        /// <returns></returns>
        public bool Update(StoreReportDto storeReportDtos)
        {
            var storeReport = Mapper.Map <StoreReportDto, StoreReport>(storeReportDtos);

            return(storeReportRepository.Update(storeReport) > 0);
        }
Example #4
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="storeReportDtos"></param>
        /// <returns></returns>
        public bool Add(StoreReportDto storeReportDtos)
        {
            var StoreReports = Mapper.Map <StoreReportDto, StoreReport>(storeReportDtos);

            return(storeReportRepository.Insert(StoreReports) > 0);
        }