Exemple #1
0
        /// <summary>
        /// APP_VersionInfo加载数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Create(int?id)
        {
            APP_VersionInfoModel model = null;

            ViewBag.IsTrueModel = SelectCommon.GetIsTrueModel();
            ViewBag.GetAppModel = SelectCommon.GetAppModel();
            if (id.HasValue)
            {
                SearchAPP_VersionInfoModel spmodel = new SearchAPP_VersionInfoModel();
                spmodel.ID         = id.Value;
                spmodel.PagedIndex = 0;
                spmodel.PagedSize  = 100;

                var result = this._aPP_VersionInfoService.GetAPP_VersionInfoList(spmodel).Data as List <APP_VersionInfoModel>;

                if (result != null && result.Count > 0)
                {
                    model = result[0];
                }
            }
            else
            {
                model = new APP_VersionInfoModel();
            }

            return(PartialView(model));
        }
Exemple #2
0
        public ActionResult Create(APP_VersionInfoModel model)
        {
            var opera = "";

            ViewBag.IsTrueModel = SelectCommon.GetIsTrueModel();
            ViewBag.GetAppModel = SelectCommon.GetAppModel();
            if (ModelState.IsValid)
            {
                ResultModel resultModel = new ResultModel();

                if (model.ID != 0)
                {
                    model.UpdateBy       = UserInfo.CurrentUserName;//asuser.UserName;
                    model.UpdateDT       = DateTime.Now;
                    resultModel.Messages = new List <string>()
                    {
                        this._aPP_VersionInfoService.UpdateAPP_VersionInfo(model).IsValid != false ? "Modify success" : "Modify failed"
                    };
                    opera = string.Format("修改APP_VersionInfo:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);
                    LogPackage.InserAC_OperateLog(opera, "APP_VersionInfo-修改");
                }
                else
                {
                    model.CreateBy = UserInfo.CurrentUserName;
                    model.CreateDT = DateTime.Now;
                    model.UpdateBy = UserInfo.CurrentUserName;
                    model.UpdateDT = DateTime.Now;


                    resultModel.Messages = new List <string>()
                    {
                        this._aPP_VersionInfoService.AddAPP_VersionInfo(model).IsValid != false ? "Add success" : "Add failed"
                    };
                    opera = string.Format("添加APP_VersionInfo:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);
                    LogPackage.InserAC_OperateLog(opera, "APP_VersionInfo-添加");
                }
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            return(PartialView(model));
        }