private void SaveConfig() { Properties.Settings.Default["GroupingAddParent"] = checkBox1.Checked; Properties.Settings.Default["GroupingZipped"] = radioButton1.Checked; Properties.Settings.Default["GroupingZipName"] = textBox1.Text; Properties.Settings.Default["GroupingSendWithoutChild"] = checkBox2.Checked; Properties.Settings.Default["GroupingInheritMarkerProperties"] = checkBox3.Checked; //New SearchProperties List <InfoShareService.SearchConditionContract> searchConditions = new List <InfoShareService.SearchConditionContract>(); foreach (DataGridViewRow row in dgwSearchProperties.Rows) { if (row.Cells.Count > 0 && row.Cells[0].Value != null) { InfoShareService.SearchConditionContract condition = new InfoShareService.SearchConditionContract { //Translate propertyname to ID PropertyTypeId = WCFHandler.GetInstance.GetPropertyTypeID(row.Cells[0].Value.ToString()) }; if (row.Cells[1].Value != null) { //BO.Utility.SearchComparisonEnum sce; Enum.TryParse(row.Cells[1].Value.ToString(), out BO.Utility.SearchComparisonEnum sce); condition.ComparisonEnum = ((int)sce).ToString(); } else { condition.ComparisonEnum = ((int)BO.Utility.SearchComparisonEnum.None).ToString(); } if (row.Cells[3].Value != null && row.Cells[3].Value.ToString() == "OR") { condition.RelationEnum = ((int)BO.Utility.SearchRelationEnum.OR).ToString(); } else { condition.RelationEnum = ((int)BO.Utility.SearchRelationEnum.AND).ToString(); } if (row.Cells[2].Value != null) { condition.Values = row.Cells[2].Value.ToString().Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries); } else { condition.Values = new string[] { "" } }; searchConditions.Add(condition); } } Properties.Settings.Default["GroupingSearchProperties"] = FileHelper.XmlSerializeToString(searchConditions); Properties.Settings.Default.Save(); }
private void SaveConfig() { Properties.Settings.Default["SMTPServerAdress"] = txtBxSMTPServer.Text; Properties.Settings.Default["SMTPPort"] = txtBxSMTPPort.Text; Properties.Settings.Default["SMTPUsername"] = txtBXSMTPUsername.Text; Properties.Settings.Default["SMPTPassword"] = txtBxSMTPPassword.Text; Properties.Settings.Default["SMTPUseSSL"] = cBUseTSL.Checked; //Mail Properties.Settings.Default["SendMailActive"] = cBSendMailActive.Checked; Properties.Settings.Default["SMTPSender"] = txtBxSMTPSender.Text; Properties.Settings.Default["EBillSendTo"] = txtBxSMTPSendTo.Text; Properties.Settings.Default["EBillSubject"] = txtBxSMTPSubject.Text; //Mail - Template Properties.Settings.Default["EmailTemplatePath"] = txtBxEmailTemplatePath.Text; Properties.Settings.Default["MultiLanguageTemplateProperty"] = txtBxMultiLanguageProperty.Text; //Mail - Attachments Properties.Settings.Default["AttachmentRenameProperty"] = txtBxAttachmentRenameProperty.Text; Properties.Settings.Default["AttachDocument"] = cBAttFile.Checked; Properties.Settings.Default["GroupingActive"] = cBGroupingActive.Checked; Properties.Settings.Default["AttachLnkFile"] = cBKxLinkFile.Checked; Properties.Settings.Default["LnkFilePath"] = txtBxLinkFilePath.Text; //DocSafe Properties.Settings.Default["DocSafeActive"] = cBDocSafeActive.Checked; //Process Properties.Settings.Default["StartProcessActive"] = cBStartProcessActive.Checked; //try //{ // string processID = (cBSelectedProcess.SelectedItem as dynamic).Value; // ProcessTemplateContract processTemplate = WCFHandler.GetInstance.GetAllProcessTemplates().Where(x => x.Id == processID).FirstOrDefault(); // Properties.Settings.Default["ProcessName"] = cBSelectedProcess.Text; //} //Properties.Settings.Default["ProcessName"] = cBSelectedProcess.Text; //if item = null its a string that needs to be evaluated on runtime. if (cBSelectedProcess.SelectedItem != null) { try { string processID = (cBSelectedProcess.SelectedItem as dynamic).Value; ProcessTemplateContract processTemplate = WCFHandler.GetInstance.GetAllProcessTemplates().Where(x => x.Id == processID).FirstOrDefault(); Properties.Settings.Default["ProcessName"] = FileHelper.XmlSerializeToString(processTemplate); } catch { } } else { Properties.Settings.Default["ProcessName"] = cBSelectedProcess.Text; } Properties.Settings.Default["ProcessRecipient"] = txtBxProcessRecipient.Text; //Kendox Server Properties.Settings.Default["KendoxWCFURL"] = txtBxKendoxWebserviceURL.Text; Properties.Settings.Default["KendoxUsername"] = txtBxKendoxUsername.Text; Properties.Settings.Default["isKXPWEncrypted"] = cbEncodePW.Checked; //AEPH 12.02.2016 Encrypt Password //Password not yet encrypted. if (txtBxKendoxPassword.Text.Length < 25 && cbEncodePW.Checked) { string[] encrypted = FileHelper.EncryptString(txtBxKendoxPassword.Text); Properties.Settings.Default["KendoxPassword"] = encrypted[0]; Properties.Settings.Default["kxpwentropy"] = encrypted[1]; } else { Properties.Settings.Default["KendoxPassword"] = txtBxKendoxPassword.Text; } if ((string)Properties.Settings.Default["Culture"] != cBCulture.Text) { MessageBox.Show("Einige Änderungen (insbesondere an der Culture) setzten einen Neustart der Applikation voraus.", "Achtung!", MessageBoxButtons.OK, MessageBoxIcon.Information); } Properties.Settings.Default["Culture"] = cBCulture.Text; //ErrorMail Properties.Settings.Default["SendErrorMail"] = cBSendErrorMail.Checked; Properties.Settings.Default["ErrorMailSendTo"] = tbErrorMailSendTo.Text; Properties.Settings.Default["ErrorMailSubject"] = tBErrorMailSubject.Text; Properties.Settings.Default["ErrorMailIncludeLog"] = cBErrorMailIncludeLog.Checked; //Report Properties.Settings.Default["IsReportActive"] = cbIsReportActive.Checked; Properties.Settings.Default["ReportRecipient"] = txtBxReportRecipient.Text; Properties.Settings.Default["ReportSubject"] = txtBxReportSubject.Text; Properties.Settings.Default["ReportTemplatePath"] = txtBxReportTemplatePath.Text; //AdditionalComputedIdentifier Properties.Settings.Default["AdditionalComputedIdentifier"] = txtBxAdditionalComputedIdentifier.Text; Properties.Settings.Default["AddCpIdisActive"] = cBAddCpIdisActive.Checked; //InfoStores string selectedStores = ""; foreach (Object checkedInfoStore in cLbInfoStores.CheckedItems) { selectedStores += checkedInfoStore + ";"; } Properties.Settings.Default["KendoxInfoStores"] = selectedStores; //SearchQuantity Properties.Settings.Default["SearchQuantity"] = Convert.ToInt32(nUdSearchQuantity.Value); //SearchProperties List <InfoShareService.SearchConditionContract> searchConditions = new List <InfoShareService.SearchConditionContract>(); foreach (DataGridViewRow row in dgwSearchProperties.Rows) { if (row.Cells.Count > 0 && row.Cells[0].Value != null) { InfoShareService.SearchConditionContract condition = new InfoShareService.SearchConditionContract { //Translate propertyname to ID PropertyTypeId = WCFHandler.GetInstance.GetPropertyTypeID(row.Cells[0].Value.ToString()) }; if (row.Cells[1].Value != null) { //BO.Utility.SearchComparisonEnum sce; Enum.TryParse(row.Cells[1].Value.ToString(), out BO.Utility.SearchComparisonEnum sce); condition.ComparisonEnum = ((int)sce).ToString(); } else { condition.ComparisonEnum = ((int)BO.Utility.SearchComparisonEnum.None).ToString(); } if (row.Cells[3].Value != null && row.Cells[3].Value.ToString() == "OR") { condition.RelationEnum = ((int)BO.Utility.SearchRelationEnum.OR).ToString(); } else { condition.RelationEnum = ((int)BO.Utility.SearchRelationEnum.AND).ToString(); } if (row.Cells[2].Value != null) { condition.Values = row.Cells[2].Value.ToString().Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries); } else { condition.Values = new string[] { "" } }; searchConditions.Add(condition); } } Properties.Settings.Default["SearchProperties"] = FileHelper.XmlSerializeToString(searchConditions); //MarkerProperties List <BO.MarkerProperty> markerProperties = new List <BO.MarkerProperty>(); //KendoxMarkerProperties foreach (DataGridViewRow row in dGwMarkerProperties.Rows) { if (row.Cells.Count > 0 && row.Cells[0].Value != null) { var propertyID = WCFHandler.GetInstance.GetPropertyTypeID(row.Cells[0].Value.ToString()); List <string> values = new List <string>(); BO.MarkerProperty.UpdateAction updateAction; if (row.Cells[1].Value != null) { values.AddRange(row.Cells[1].Value.ToString().Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries).ToList()); } //else // values = new string[1] { "" }; updateAction = BO.MarkerProperty.UpdateAction.UPDATE; if (row.Cells[2].Value != null) { switch (row.Cells[2].Value.ToString().ToLower()) { case "none": updateAction = BO.MarkerProperty.UpdateAction.NONE; break; case "update": updateAction = BO.MarkerProperty.UpdateAction.UPDATE; break; case "add": updateAction = BO.MarkerProperty.UpdateAction.ADD; break; case "delete": updateAction = BO.MarkerProperty.UpdateAction.DELETE; break; } } ; markerProperties.Add(new BO.MarkerProperty(propertyID, values.ToArray(), updateAction)); } } Properties.Settings.Default["MarkerProperties"] = FileHelper.XmlSerializeToString(markerProperties); //Decapped //Properties.Settings.Default["CustomWSFunctionsActive"] = cBCustomWSFunction.Checked; ////Custom WS Functions //List<Forms.ExpressionVariablesForm.KeyValuePair<string, string>> variables = new List<Forms.ExpressionVariablesForm.KeyValuePair<string, string>>(); //foreach (DataGridViewRow row in dgwCustomWSFunction.Rows) //{ // if (row.Cells.Count > 0 && row.Cells[0].Value != null && row.Cells[1].Value != null) // { // Forms.ExpressionVariablesForm.KeyValuePair<string, string> kvp = new Forms.ExpressionVariablesForm.KeyValuePair<string, string>(); // kvp.Key = row.Cells[0].Value.ToString(); // kvp.Value = row.Cells[1].Value.ToString(); // variables.Add(kvp); // } //} //Properties.Settings.Default["CustomWSFunctions"] = FileHelper.XmlSerializeToString(variables); //if (variables.Count <= 0) // Properties.Settings.Default["CustomWSFunctionsActive"] = false; Properties.Settings.Default.Save(); }