Example #1
0
 public JsonResult BackgroundProcessSettings(BackgroundProcessSettingsViewModal model)
 {
     try
     {
         SettingFacade             fac      = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);
         CleanseMatchSettingsModel oldmodel = new CleanseMatchSettingsModel();
         oldmodel.Settings = fac.GetCleanseMatchSettings();
         CommonMethod.GetSettingIDs(oldmodel);
         if (CommonMethod.IsDigitsOnly(model.MAX_PARALLEL_THREAD) && CommonMethod.IsDigitsOnly(model.BATCH_SIZE) && CommonMethod.IsDigitsOnly(model.WAIT_TIME_BETWEEN_BATCHES_SECS))
         {
             oldmodel.Settings[oldmodel.MAX_PARALLEL_THREAD].SettingValue            = model.MAX_PARALLEL_THREAD;
             oldmodel.Settings[oldmodel.BATCH_SIZE].SettingValue                     = model.BATCH_SIZE;
             oldmodel.Settings[oldmodel.WAIT_TIME_BETWEEN_BATCHES_SECS].SettingValue = model.WAIT_TIME_BETWEEN_BATCHES_SECS;
             //update Cleanse Match Settings
             fac.UpdateCleanseMatchSettings(oldmodel.Settings);
             return(Json(new { result = true, Message = DandBSettingLang.msgSettingUpdate }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { result = false, Message = DandBSettingLang.msgInvadilState }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception)
     {
         return(Json(new { result = false, Message = CommonMessagesLang.msgSomethingWrong }, JsonRequestBehavior.AllowGet));
     }
 }
Example #2
0
        public ActionResult BackgroundProcessSettings()
        {
            SettingFacade fac = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);
            // Fill all dropdown and value for setting value.
            List <SettingEntity> Settings = fac.GetCleanseMatchSettings();
            BackgroundProcessSettingsViewModal viewModal = new BackgroundProcessSettingsViewModal();

            if (Settings != null && Settings.Any())
            {
                CommonMethod objCommon = new CommonMethod();
                var          objResult = objCommon.LoadCleanseMatchSettings(this.CurrentClient.ApplicationDBConnectionString);
                viewModal.MAX_PARALLEL_THREAD            = objCommon.GetSettingIDs(objResult, "MAX_PARALLEL_THREAD");
                viewModal.BATCH_SIZE                     = objCommon.GetSettingIDs(objResult, "BATCH_SIZE");
                viewModal.WAIT_TIME_BETWEEN_BATCHES_SECS = objCommon.GetSettingIDs(objResult, "WAIT_TIME_BETWEEN_BATCHES_SECS");
            }
            return(PartialView(viewModal));
        }