public SettingCMSModel()
 {
     HomepageCMSModel = new HomepageCMSModel();
     GenericIntroducingSettingModel = new GenericIntroducingSettingModel();
     ContactCMSModel = new ContactCMSModel();
     InvestmentTargetSettingModel = new ListInvestmentTargetSettingModel();
     ListWithdrawFee    = new ListWithdrawFee();
     ListMaintainingFee = new ListMaintainingFee();
     HasError           = false;
 }
        public async Task <IActionResult> UpdateContactCMS(ContactCMSModel contactCMSModel)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            await _contactConfigurationService.UpdateContactCMS(contactCMSModel);

            return(RedirectToAction("Index", "SettingsCMS"));
        }
Exemple #3
0
 public async Task <ContactCMS> UpdateContactCMS(ContactCMSModel contactCMSModel)
 {
     try
     {
         var contactCMSDto = _mapper.Map <ContactCMSModel, ContactCMS>(contactCMSModel);
         return(await _contactCMSManager.UpdateContactConfiguration(contactCMSDto));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #4
0
        public async Task <ContactCMSModel> AddDefault(ContactCMSModel ContactModel)
        {
            try
            {
                ContactCMS model      = _mapper.Map <ContactCMS>(ContactModel);
                ContactCMS addedModel = await _contactCMSManager.AddDefault(model);

                ContactCMSModel savedModel = _mapper.Map <ContactCMSModel>(addedModel);
                return(savedModel);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public async Task <IActionResult> DisplayContactCMS()
        {
            var data = _contactConfigurationService.GetContactConfiguration();

            if (data == null)
            {
                //default value
                data = new ContactCMSModel
                {
                    Email             = "*****@*****.**",
                    Phone             = "0123456789",
                    EmailForReceiving = "*****@*****.**",
                };
                try
                {
                    await Add(data);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(View(data));
        }
        public async Task <IActionResult> Add(ContactCMSModel model)
        {
            await _contactConfigurationService.AddDefault(model);

            return(RedirectToAction(nameof(ContactCMSController.DisplayContactCMS)));
        }