Пример #1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public bool Update(XCLCMS.Data.Model.Tags model)
        {
            Database  db        = base.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("sp_Tags_Update");

            db.AddInParameter(dbCommand, "TagsID", DbType.Int64, model.TagsID);
            db.AddInParameter(dbCommand, "TagName", DbType.String, model.TagName);
            db.AddInParameter(dbCommand, "Description", DbType.String, model.Description);
            db.AddInParameter(dbCommand, "FK_MerchantID", DbType.Int64, model.FK_MerchantID);
            db.AddInParameter(dbCommand, "FK_MerchantAppID", DbType.Int64, model.FK_MerchantAppID);
            db.AddInParameter(dbCommand, "RecordState", DbType.AnsiString, model.RecordState);
            db.AddInParameter(dbCommand, "CreateTime", DbType.DateTime, model.CreateTime);
            db.AddInParameter(dbCommand, "CreaterID", DbType.Int64, model.CreaterID);
            db.AddInParameter(dbCommand, "CreaterName", DbType.String, model.CreaterName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "UpdaterID", DbType.Int64, model.UpdaterID);
            db.AddInParameter(dbCommand, "UpdaterName", DbType.String, model.UpdaterName);

            db.AddOutParameter(dbCommand, "ResultCode", DbType.Int32, 4);
            db.AddOutParameter(dbCommand, "ResultMessage", DbType.String, 1000);
            db.ExecuteNonQuery(dbCommand);

            var result = XCLCMS.Data.DAL.Common.Common.GetProcedureResult(dbCommand.Parameters);

            if (result.IsSuccess)
            {
                return(true);
            }
            else
            {
                throw new Exception(result.ResultMessage);
            }
        }
Пример #2
0
        public override ActionResult UpdateSubmit(FormCollection fm)
        {
            XCLNetTools.Message.MessageModel msgModel = new XCLNetTools.Message.MessageModel();

            var viewModel = this.GetViewModel(fm);
            var model     = new XCLCMS.Data.Model.Tags();

            model.TagsID = viewModel.Tags.TagsID;

            model.RecordState      = viewModel.Tags.RecordState;
            model.TagName          = viewModel.Tags.TagName;
            model.UpdaterID        = base.UserID;
            model.UpdaterName      = base.CurrentUserModel.UserName;
            model.UpdateTime       = DateTime.Now;
            model.FK_MerchantAppID = viewModel.Tags.FK_MerchantAppID;
            model.FK_MerchantID    = viewModel.Tags.FK_MerchantID;
            model.Description      = viewModel.Tags.Description;

            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest <XCLCMS.Data.Model.Tags>(base.UserToken);

            request.Body = new Data.Model.Tags();
            request.Body = model;
            var response = XCLCMS.Lib.WebAPI.TagsAPI.Update(request);

            return(Json(response));
        }
Пример #3
0
        public override ActionResult AddSubmit(FormCollection fm)
        {
            XCLNetTools.Message.MessageModel msgModel = new XCLNetTools.Message.MessageModel();

            var viewModel = this.GetViewModel(fm);
            var model     = new XCLCMS.Data.Model.Tags();

            model.TagsID = XCLCMS.Lib.WebAPI.Library.CommonAPI_GenerateID(base.UserToken, new Data.WebAPIEntity.RequestEntity.Common.GenerateIDEntity()
            {
                IDType = Data.CommonHelper.EnumType.IDTypeEnum.LIK.ToString()
            });
            model.CreaterID        = base.UserID;
            model.CreaterName      = base.CurrentUserModel.UserName;
            model.CreateTime       = DateTime.Now;
            model.RecordState      = viewModel.Tags.RecordState;
            model.TagName          = viewModel.Tags.TagName;
            model.UpdaterID        = base.UserID;
            model.UpdaterName      = base.CurrentUserModel.UserName;
            model.UpdateTime       = DateTime.Now;
            model.FK_MerchantAppID = viewModel.Tags.FK_MerchantAppID;
            model.FK_MerchantID    = viewModel.Tags.FK_MerchantID;
            model.Description      = viewModel.Tags.Description;

            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest <XCLCMS.Data.Model.Tags>(base.UserToken);

            request.Body = new Data.Model.Tags();
            request.Body = model;
            var response = XCLCMS.Lib.WebAPI.TagsAPI.Add(request);

            return(Json(response));
        }
Пример #4
0
 /// <summary>
 ///  更新一条数据
 /// </summary>
 public bool Update(XCLCMS.Data.Model.Tags model)
 {
     return(dal.Update(model));
 }
Пример #5
0
 /// <summary>
 ///  增加一条数据
 /// </summary>
 public bool Add(XCLCMS.Data.Model.Tags model)
 {
     return(dal.Add(model));
 }