public bool InsertApplicationConfig(ApplicationConfigModel model) { try { if (model == null) { return(false); } var item = new ApplicationConfig { Name = model.Name, Code = model.Code, Description = model.Description, ApprovalKind = model.ApprovalKind, ApprovalLineDefault = model.ApprovalLineDefault, ApprovalLineJson = model.ApprovalLineJson, DeptId = model.DeptId, CreateDate = DateTime.Now, CreateUid = model.CreateUid }; _db.ApplicationConfig.Add(item); _db.SaveChanges(); return(true); } catch (Exception ex) { LogHelper.Error("ApplicationConfigRepository Insert: " + ex.Message + " Inner exception: " + ex.InnerException.Message); return(false); } }
public bool UpdateApplicationConfig(ApplicationConfigModel model) { try { if (model == null) { return(false); } var item = (from c in _db.ApplicationConfig where c.Id == model.Id select c).FirstOrDefault(); if (item == null) { return(false); } item.Name = model.Name; item.Code = model.Code; item.Description = model.Description; item.ApprovalKind = model.ApprovalKind; item.ApprovalLineDefault = model.ApprovalLineDefault; item.ApprovalLineJson = model.ApprovalLineJson; item.DeptId = model.DeptId; item.UpdateDate = DateTime.Now; item.UpdateUId = model.CreateUid; _db.SaveChanges(); return(true); } catch (Exception ex) { LogHelper.Error("ApplicationConfigRepository Update: " + ex.Message + " Inner exception: " + ex.InnerException.Message); return(false); } }
public ActionResult Delete(ApplicationConfigModel model) { var rep = new ApplicationConfigRepository(); var response = rep.DeleteApplicationConfig(model.Id, User.GetClaimValue(ClaimTypes.PrimarySid)); return(Json(response ? new { result = "OK" } : new { result = "ERROR" })); }
public ConfigurationService(CommandService commandService) { ToolbarConfiguration = new ToolbarConfigModel { IsFileVisible = true, IsEditVisible = true, IsViewVisible = true, IsHelpVisible = true, IsVisible = true }; PaneConfiguration = new PaneConfigModel { NavigationPaneWidthPx = 220, PreviewOrDetailsPanePaneWidthPx = 240, IsNavigationPaneVisible = true, IsDetailsPaneVisible = false, IsPreviewPaneVisible = false, IsDetailsView = false, IsThumbnailView = true }; ApplicationConfiguration = new ApplicationConfigModel(); _commandService = commandService; _onSimpleCommand = commandService.EventAggregator.Subscribe <CommandType>(SimpleCommandAction); _onParameterizedCommand = commandService.EventAggregator.Subscribe <KeyValuePair <CommandType, object> >(ParameterizedCommandAction); }
public RiotAPIService( ApplicationConfigModel applicationConfig) { _applicationConfig = applicationConfig; ApiValidate(); }
public ActionResult Insert(ApplicationConfigModel model) { model.CreateUid = User.GetClaimValue(ClaimTypes.PrimarySid); var rep = new ApplicationConfigRepository(); var response = rep.InsertApplicationConfig(model); return(Json(response ? new { result = "OK" } : new { result = "ERROR" })); }
/// <summary> /// This method creates the job application specific LaTEX file "application_details.tex". It will be used in letter of application. The method doesn't return anything. /// </summary> /// <param name="ApplicationConfigModel">Application Model (contains the Jobtitle, Company, Contact etc...)</param> public static void CreateApplicationConfig(ApplicationConfigModel acm) { string[] lines = { "\\def\\jobtitle{" + acm.JobTitle + "}", "\\def\\company{" + acm.Company + "}", "\\def\\contact{" + acm.Contact + "}", "\\def\\street{" + acm.Street + "}", "\\def\\city{" + acm.City + "}", "\\def\\salutation{" + acm.Salutation + "}", "\\def\\subject{" + acm.Subject + "}", "\\def\\addressstring{" + acm.Address + "}" }; string mytmpDir = Path.Combine(tmpDir, "latex_curriculum_vitae"); using StreamWriter outputFile = new StreamWriter(Path.Combine(mytmpDir, "application_details.tex")); foreach (string line in lines) { outputFile.WriteLine(line); } }
public static void DeleteTenantDb(string templateDb, string newTenantDb, ApplicationConfigModel applicationModel) { var creds = new AzureCredentialsFactory().FromServicePrincipal(applicationModel.ClientId, applicationModel.ClientSecret, applicationModel.TenantId, AzureEnvironment.AzureGlobalCloud); IAzure azure = Azure.Authenticate(creds).WithSubscription(applicationModel.Subscription); var db = azure.SqlServers.Databases; //This retrieves the SQL server from the resourcegroup where the database needs to be created in var sqlServer = azure.SqlServers.GetByResourceGroup(applicationModel.ResourceGroupName, applicationModel.ServerName); //This database is the template database that is used for creating a new database var templatedb = sqlServer.Databases.Get(templateDb); //Create a new database based on the template database and define your name of your new database sqlServer.Databases.Delete(newTenantDb); }
public virtual ActionResult Edit(Guid id) { var e = GetEvent(id); var config = new ApplicationConfigModel() { AppPassCode = e.ApplicationConfig.AppPassCode, CurrentVersion = e.ApplicationConfig.CurrentVersion, ForceUpdate = e.ApplicationConfig.ForceUpdate, UpdateAppUri = e.ApplicationConfig.UpdateAppUri, HasGoLiveDate = e.ApplicationConfig.GoLiveDate.HasValue, GoLiveDate = new ModelTime { Date = e.ApplicationConfig.GoLiveDateLocal ?? DateTime.Now }, LanServiceUri = e.ApplicationConfig.LanServiceUri, ReportMoodIsStaleMins = e.ApplicationConfig.ReportMoodIsStaleMins, ReportPassCode = e.ApplicationConfig.ReportPassCode, ReportSplineTension = e.ApplicationConfig.ReportSplineTension, SyncDataInterval = e.ApplicationConfig.SyncDataInterval, SyncMode = e.ApplicationConfig.SyncMode, SyncReportInterval = e.ApplicationConfig.SyncReportInterval, TimeZone = e.ApplicationConfig.TimeZone, WarnSyncFailureAfterMins = e.ApplicationConfig.WarnSyncFailureAfterMins, WebServiceUri = e.ApplicationConfig.WebServiceUri }; var model = new EditEventModel() { Id = e.Id, Name = e.Name, Title = e.Title, StartDate = new ModelTime { Date = e.StartDateLocal ?? DateTime.Today }, EndDate = new ModelTime { Date = e.EndDateLocal ?? DateTime.Today }, ApplicationConfig = config }; PopulateModelLists(model); return(PartialView(model)); }
internal void LoadConfigurations() { ApplicationConfiguration = _configService.Get <ApplicationConfigModel>(); if (ApplicationConfiguration == null) { ApplicationConfiguration = new ApplicationConfigModel(); } ToolbarConfiguration = _configService.Get <ToolbarConfigModel>(); if (ToolbarConfiguration == null) { ToolbarConfiguration = new ToolbarConfigModel { IsFileVisible = true, IsEditVisible = true, IsViewVisible = true, IsHelpVisible = true, IsVisible = true }; } PaneConfiguration = _configService.Get <PaneConfigModel>(); if (PaneConfiguration == null) { PaneConfiguration = new PaneConfigModel { NavigationPaneWidthPx = 220, PreviewOrDetailsPanePaneWidthPx = 240, IsNavigationPaneVisible = true, IsDetailsPaneVisible = false, IsPreviewPaneVisible = false, IsDetailsView = false, IsThumbnailView = true }; } }
private void BtnGenerate_Click(object sender, EventArgs e) { #region Private Variables string addressline; bool compemail_set; #endregion Private Variables #region Cleanup Setup.Cleanup(); #endregion Cleanup #region Settings User myuser = new User(); #endregion Settings #region JobApplication Data JobApplication myapplication = new JobApplication(txtURL.Text, txtEmail.Text, txtJobtitle.Text); if (myuser.BitLyToken != "Not Found" && !string.IsNullOrEmpty(myapplication.URL)) { System.Threading.Tasks.Task task = myapplication.UseBitLy(myuser.BitLyToken, myapplication.URL); } else { //Test } if (string.IsNullOrEmpty(myapplication.Email)) { compemail_set = false; } else { compemail_set = true; } Company company; if (string.IsNullOrEmpty(txtCompanyStreet.Text) || (string.IsNullOrEmpty(txtZIP.Text)) || (string.IsNullOrEmpty(txtCity.Text))) { company = new Company(txtCompanyName.Text); } else { company = new Company(txtCompanyName.Text, txtCompanyStreet.Text, txtZIP.Text, txtCity.Text); } ComboBoxItem typeItem = (ComboBoxItem)cboGender.SelectedItem; string gender = typeItem.Content.ToString(); Contact contact = new Contact(txtContactName.Text, gender); addressline = contact.Addressline(company.Name, contact.Name, contact.Gender, company.Street, company.ZIP, company.City); #endregion JobApplication Data #region Build, Compile and Send Build.PrepareBuild(); string subject = Build.GetSubject(SubjectPrefixGlob, myapplication.Jobtitle); ApplicationConfigModel acm = new ApplicationConfigModel { JobTitle = myapplication.Jobtitle, Company = company.Name, Contact = contact.Name, Street = company.Street, City = company.City, Salutation = contact.Salutation, Subject = subject, Address = addressline }; Build.CreateApplicationConfig(acm); Build.CompileApplication(); Build.CombineApplication(myuser.Firstname, myuser.Familyname); if (!compemail_set) { Build.OpenExplorer(); } else { subject = Build.GetEmailSubject(SubjectPrefixGlob, myapplication.Jobtitle); string finalpdf = Build.GetFinalPdfName(myuser.Firstname, myuser.Familyname); EmailModel email = new EmailModel { FirstName = myuser.Firstname, FamilyName = myuser.Familyname, MyEmail = myuser.Email, ContactName = contact.Name, CompEmail = myapplication.Email, Subject = subject, Salutation = contact.Salutation, Attachment = finalpdf, SmtpServer = myuser.SmtpServer, SmtpUser = myuser.SmtpUser, SmtpPass = myuser.SmtpPass, SmtpPort = myuser.SmtpPort }; Email.CreateMessage(email); } #endregion Build, Compile and Send #region Add Information to CSV CsvExport.WriteCSV(company.Name, myapplication.Jobtitle, company.City, myapplication.URL); #endregion Add Information to CSV #region Clean UI txtCity.Clear(); txtCompanyName.Clear(); txtCompanyStreet.Clear(); txtContactName.Clear(); txtEmail.Clear(); txtJobtitle.Clear(); txtURL.Clear(); txtZIP.Clear(); chkInitiative.IsChecked = false; SubjectPrefixGlob = Properties.Resources.Subjectprefix; #endregion Clean UI }
static ApplicationConfigHandler() { config = ConfigurationHandler <ApplicationConfigModel> .ReadConfig(); }
public ApplicationUpdateConfigService( ApplicationConfigModel applicationConfig) { _applicationConfig = applicationConfig; }