Exemplo n.º 1
0
        public override ActionResult UpdateSubmit(FormCollection fm)
        {
            base.UpdateSubmit(fm);
            XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM viewModel = this.GetViewModel(fm);

            var model = new XCLCMS.Data.Model.Merchant();

            model.MerchantID      = XCLNetTools.StringHander.FormHelper.GetLong("merchantId");
            model.Address         = viewModel.Merchant.Address;
            model.ContactName     = viewModel.Merchant.ContactName;
            model.Domain          = viewModel.Merchant.Domain;
            model.Email           = viewModel.Merchant.Email;
            model.Landline        = viewModel.Merchant.Landline;
            model.LogoURL         = viewModel.Merchant.LogoURL;
            model.MerchantName    = viewModel.Merchant.MerchantName;
            model.MerchantRemark  = viewModel.Merchant.MerchantRemark;
            model.MerchantState   = viewModel.Merchant.MerchantState;
            model.FK_MerchantType = viewModel.Merchant.FK_MerchantType;
            model.OtherContact    = viewModel.Merchant.OtherContact;
            model.PassNumber      = viewModel.Merchant.PassNumber;
            model.FK_PassType     = viewModel.Merchant.FK_PassType;
            model.QQ                 = viewModel.Merchant.QQ;
            model.RegisterTime       = viewModel.Merchant.RegisterTime;
            model.Remark             = viewModel.Merchant.Remark;
            model.Tel                = viewModel.Merchant.Tel;
            model.MerchantSystemType = viewModel.Merchant.MerchantSystemType;
            model.RecordState        = viewModel.Merchant.RecordState;

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

            request.Body = model;
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.Update(request);

            return(Json(response));
        }
Exemplo n.º 2
0
        public override ActionResult AddSubmit(FormCollection fm)
        {
            XCLCMS.View.AdminWeb.Models.Merchant.MerchantAddVM viewModel = this.GetViewModel(fm);
            XCLCMS.Data.Model.Merchant model = new XCLCMS.Data.Model.Merchant();
            model.MerchantID = XCLCMS.Lib.WebAPI.Library.CommonAPI_GenerateID(base.UserToken, new Data.WebAPIEntity.RequestEntity.Common.GenerateIDEntity()
            {
                IDType = Data.CommonHelper.EnumType.IDTypeEnum.MER.ToString()
            });
            model.Address         = viewModel.Merchant.Address;
            model.ContactName     = viewModel.Merchant.ContactName;
            model.Domain          = viewModel.Merchant.Domain;
            model.Email           = viewModel.Merchant.Email;
            model.Landline        = viewModel.Merchant.Landline;
            model.LogoURL         = viewModel.Merchant.LogoURL;
            model.MerchantName    = viewModel.Merchant.MerchantName;
            model.MerchantRemark  = viewModel.Merchant.MerchantRemark;
            model.MerchantState   = viewModel.Merchant.MerchantState;
            model.FK_MerchantType = viewModel.Merchant.FK_MerchantType;
            model.OtherContact    = viewModel.Merchant.OtherContact;
            model.PassNumber      = viewModel.Merchant.PassNumber;
            model.FK_PassType     = viewModel.Merchant.FK_PassType;
            model.QQ                 = viewModel.Merchant.QQ;
            model.RecordState        = viewModel.Merchant.RecordState;
            model.RegisterTime       = viewModel.Merchant.RegisterTime;
            model.Remark             = viewModel.Merchant.Remark;
            model.Tel                = viewModel.Merchant.Tel;
            model.MerchantSystemType = viewModel.Merchant.MerchantSystemType;

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

            request.Body = model;
            var response = XCLCMS.Lib.WebAPI.MerchantAPI.Add(request);

            return(Json(response));
        }
Exemplo n.º 3
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public bool Update(XCLCMS.Data.Model.Merchant model)
        {
            Database  db        = base.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("sp_Merchant_Update");

            db.AddInParameter(dbCommand, "MerchantID", DbType.Int64, model.MerchantID);
            db.AddInParameter(dbCommand, "MerchantName", DbType.String, model.MerchantName);
            db.AddInParameter(dbCommand, "FK_MerchantType", DbType.Int64, model.FK_MerchantType);
            db.AddInParameter(dbCommand, "MerchantSystemType", DbType.AnsiString, model.MerchantSystemType);
            db.AddInParameter(dbCommand, "Domain", DbType.AnsiString, model.Domain);
            db.AddInParameter(dbCommand, "LogoURL", DbType.AnsiString, model.LogoURL);
            db.AddInParameter(dbCommand, "ContactName", DbType.String, model.ContactName);
            db.AddInParameter(dbCommand, "Tel", DbType.AnsiString, model.Tel);
            db.AddInParameter(dbCommand, "Landline", DbType.AnsiString, model.Landline);
            db.AddInParameter(dbCommand, "Email", DbType.AnsiString, model.Email);
            db.AddInParameter(dbCommand, "QQ", DbType.AnsiString, model.QQ);
            db.AddInParameter(dbCommand, "FK_PassType", DbType.Int64, model.FK_PassType);
            db.AddInParameter(dbCommand, "PassNumber", DbType.AnsiString, model.PassNumber);
            db.AddInParameter(dbCommand, "Address", DbType.String, model.Address);
            db.AddInParameter(dbCommand, "OtherContact", DbType.String, model.OtherContact);
            db.AddInParameter(dbCommand, "MerchantRemark", DbType.String, model.MerchantRemark);
            db.AddInParameter(dbCommand, "RegisterTime", DbType.DateTime, model.RegisterTime);
            db.AddInParameter(dbCommand, "MerchantState", DbType.AnsiString, model.MerchantState);
            db.AddInParameter(dbCommand, "Remark", DbType.AnsiString, model.Remark);
            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);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(XCLCMS.Data.Model.Merchant model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(XCLCMS.Data.Model.Merchant model)
 {
     return(dal.Add(model));
 }