public ActionResult EditOpenMasConfigPost(EditOpenMasConfigModel model)
 {
     try
     {
         model.Unit = new NpcContext().CurrentUser.Unit;
         _openMasConfigAction.EditOpenMasConfig(model);
         return RedirectToMessage("OpenMas服务配置完成!");
     }
     catch (Exception exception)
     {
         return RedirectToMessage(exception.Message);
     }
 }
Esempio n. 2
0
 public void EditOpenMasConfig(EditOpenMasConfigModel model)
 {
     var config = _openMasConfigRepository.GetOpenMasConfigByUnit(model.Unit.Id) ?? new OpenMasConfig();
     config.MmsAppAccount = model.MmsAppAccount;
     config.MmsAppPwd = model.MmsAppPwd;
     config.MmsExtensionNo = model.MmsExtensionNo;
     config.MmsMasService = model.MmsMasService;
     config.SmsAppAccount = model.SmsAppAccount;
     config.SmsAppPwd = model.SmsAppPwd;
     config.SmsExtensionNo = model.SmsExtensionNo;
     config.SmsMasService = model.SmsMasService;
     config.Unit = model.Unit;
     config.Signature = model.Signature;
     config.RecordDescription.CreateBy(NpcContext.CurrentUser);
     _openMasConfigRepository.Save(config);
 }
Esempio n. 3
0
        public EditOpenMasConfigModel InitializeEditOpenMasConfigModel(Unit unit)
        {
            var model = new EditOpenMasConfigModel();
            var config = _openMasConfigRepository.GetOpenMasConfigByUnit(unit.Id);
            if (config == null)
                return model;
            model.MmsAppAccount = config.MmsAppAccount;
            model.MmsAppPwd = config.MmsAppPwd;
            model.MmsExtensionNo = config.MmsExtensionNo;
            model.MmsMasService = config.MmsMasService;

            model.SmsAppAccount = config.SmsAppAccount;
            model.SmsAppPwd = config.SmsAppPwd;
            model.SmsExtensionNo = config.SmsExtensionNo;
            model.SmsMasService = config.SmsMasService;

            model.Signature = config.Signature;
            return model;
        }