Пример #1
0
 public ActionResult SaveTenant(string TenantCode, string TenantName, string ContactName, string PhoneNumber, string QQ, string Email, string ExpireTime, string TenantLogoImgURl)
 {
     UpdateTenantViewModel param = new UpdateTenantViewModel();
     param.TenantCode = TenantCode;
     param.TenantName = TenantName;
     param.ContactName = ContactName;
     param.PhoneNumber = PhoneNumber;
     param.QQ = QQ;
     param.Email = Email;
     if (!string.IsNullOrEmpty(ExpireTime))
     {
         param.ExpireTime = Convert.ToDateTime(ExpireTime);
     }
     param.TenantLogoImgURl = TenantLogoImgURl;
     CommandResultViewModel dbResult = this._OperationsService.UpdateOperateMyData(param);
     if (dbResult.CommandResult == 0)
     {
         //修改自己时要同步到session中
         if (TenantCode == SessionUserInfo.TenantCode)
         {
             SessionUserInfo.TenantName = TenantName;
             SessionUserInfo.QQ = QQ;
             SessionUserInfo.Email = Email;
         }
     }
     return Json(new
     {
         result = ((int)dbResult.CommandResult == 0) ? 1 : 0,
         data = dbResult.Msg
     });
 }
Пример #2
0
 public ActionResult Save(string tenantCode, string phoneNumber, string tenantName, string qq, string email)
 {
     UpdateTenantViewModel model = new UpdateTenantViewModel()
     {
         TenantCode = tenantCode,
         PhoneNumber = phoneNumber,
         TenantName = tenantName,
         Email = email,
         QQ = qq
     };
     CommandResultViewModel result = _ISysSettingWCFService.UpdateUserCenterMyData(model);
     return Content(result.Msg);
 }
Пример #3
0
        public CommandResultViewModel UpdateUserCenterMyData(UpdateTenantViewModel model)
        {
            CommandResultViewModel vm = new CommandResultViewModel();
            try
            {
                EMTenantService tenantService = new EMTenantService();

                var isExists = tenantService.IsExists(model.TenantName, model.TenantCode);
                if (isExists)
                {
                    vm.CommandResult = EnumCommandResult.MisMatchCondition;
                    vm.Msg = string.Format("客户名称" + model.TenantName + "已经存在,请重新输入!");
                    return vm;
                }
                else
                {
                    EMTenant tenant = tenantService.Select(model.TenantCode);
                    tenant.Email = model.Email;
                    tenant.TenantName = model.TenantName;
                    tenant.PhoneNumber = model.PhoneNumber;
                    tenant.QQ = model.QQ;
                    tenantService.Update(tenant);
                    vm.CommandResult = EnumCommandResult.Success;
                    vm.Msg = "修改成功!";
                    return vm;
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message, ex);
                vm.CommandResult = EnumCommandResult.Failed;
                vm.Msg = ex.Message;
                return vm;
            }
        }
Пример #4
0
        public CommandResultViewModel UpdateOperateMyData(UpdateTenantViewModel model)
        {
            CommandResultViewModel vm = new CommandResultViewModel();
            try
            {
                EMTenantService tenantService = new EMTenantService();

                var isExists = tenantService.IsExists(model.TenantName, model.TenantCode);
                if (isExists)
                {
                    vm.CommandResult = EnumCommandResult.MisMatchCondition;
                    vm.Msg = string.Format("客户名称" + model.TenantName + "已经存在,请重新输入!");
                    return vm;
                }
                else
                {
                    EMTenant tenant = tenantService.Select(model.TenantCode);
                    tenant.Email = model.Email;
                    tenant.TenantName = model.TenantName;
                    tenant.PhoneNumber = model.PhoneNumber;
                    tenant.ContactName = model.ContactName;
                    tenant.QQ = model.QQ;
                    tenant.LogoUrl = UploadImageHelper.GetImgName(model.TenantLogoImgURl);
                    tenant.ExpireTime = model.ExpireTime;
                    tenantService.Update(tenant);
                    vm.CommandResult = EnumCommandResult.Success;
                    vm.Msg = "修改成功!";
                }
            }
            catch (Exception ex)
            {
                Logger.Error("OperateManagerWCFService.UpdateOperateMyData(UpdateTenantViewModel model)失败,错误:" + ex.Message, ex);
                vm.CommandResult = EnumCommandResult.Failed;
                vm.Msg = ex.Message;
            }
            return vm;
        }