terminado form de config
This commit is contained in:
126
Vista/FrmInforme.Designer.cs
generated
126
Vista/FrmInforme.Designer.cs
generated
@@ -28,19 +28,145 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
label1 = new Label();
|
||||
label2 = new Label();
|
||||
label3 = new Label();
|
||||
dgvEmailTarget = new DataGridView();
|
||||
txtEmailAddr = new TextBox();
|
||||
txtEmailPass = new TextBox();
|
||||
txtEmailTargetAdd = new TextBox();
|
||||
btnAñadir = new Button();
|
||||
btnGuardar = new Button();
|
||||
btnEliminar = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dgvEmailTarget).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(12, 22);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(65, 15);
|
||||
label1.TabIndex = 0;
|
||||
label1.Text = "Email Addr";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(12, 48);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(62, 15);
|
||||
label2.TabIndex = 1;
|
||||
label2.Text = "Email Pass";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(12, 76);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(71, 15);
|
||||
label3.TabIndex = 2;
|
||||
label3.Text = "Email Target";
|
||||
//
|
||||
// dgvEmailTarget
|
||||
//
|
||||
dgvEmailTarget.AllowUserToAddRows = false;
|
||||
dgvEmailTarget.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dgvEmailTarget.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
dgvEmailTarget.EnableHeadersVisualStyles = false;
|
||||
dgvEmailTarget.Location = new Point(89, 76);
|
||||
dgvEmailTarget.Name = "dgvEmailTarget";
|
||||
dgvEmailTarget.RowTemplate.Height = 25;
|
||||
dgvEmailTarget.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dgvEmailTarget.Size = new Size(240, 150);
|
||||
dgvEmailTarget.TabIndex = 3;
|
||||
//
|
||||
// txtEmailAddr
|
||||
//
|
||||
txtEmailAddr.Location = new Point(89, 18);
|
||||
txtEmailAddr.Name = "txtEmailAddr";
|
||||
txtEmailAddr.Size = new Size(202, 23);
|
||||
txtEmailAddr.TabIndex = 4;
|
||||
//
|
||||
// txtEmailPass
|
||||
//
|
||||
txtEmailPass.Location = new Point(89, 47);
|
||||
txtEmailPass.Name = "txtEmailPass";
|
||||
txtEmailPass.PasswordChar = '*';
|
||||
txtEmailPass.Size = new Size(202, 23);
|
||||
txtEmailPass.TabIndex = 5;
|
||||
//
|
||||
// txtEmailTargetAdd
|
||||
//
|
||||
txtEmailTargetAdd.Location = new Point(335, 76);
|
||||
txtEmailTargetAdd.Name = "txtEmailTargetAdd";
|
||||
txtEmailTargetAdd.Size = new Size(197, 23);
|
||||
txtEmailTargetAdd.TabIndex = 6;
|
||||
//
|
||||
// btnAñadir
|
||||
//
|
||||
btnAñadir.Location = new Point(335, 105);
|
||||
btnAñadir.Name = "btnAñadir";
|
||||
btnAñadir.Size = new Size(75, 23);
|
||||
btnAñadir.TabIndex = 7;
|
||||
btnAñadir.Text = "Añadir";
|
||||
btnAñadir.UseVisualStyleBackColor = true;
|
||||
btnAñadir.Click += btnAñadir_Click;
|
||||
//
|
||||
// btnGuardar
|
||||
//
|
||||
btnGuardar.Location = new Point(89, 232);
|
||||
btnGuardar.Name = "btnGuardar";
|
||||
btnGuardar.Size = new Size(75, 23);
|
||||
btnGuardar.TabIndex = 8;
|
||||
btnGuardar.Text = "Guardar";
|
||||
btnGuardar.UseVisualStyleBackColor = true;
|
||||
btnGuardar.Click += btnGuardar_Click;
|
||||
//
|
||||
// btnEliminar
|
||||
//
|
||||
btnEliminar.Location = new Point(335, 134);
|
||||
btnEliminar.Name = "btnEliminar";
|
||||
btnEliminar.Size = new Size(75, 23);
|
||||
btnEliminar.TabIndex = 9;
|
||||
btnEliminar.Text = "Eliminar";
|
||||
btnEliminar.UseVisualStyleBackColor = true;
|
||||
btnEliminar.Click += btnEliminar_Click;
|
||||
//
|
||||
// FrmInforme
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(btnEliminar);
|
||||
Controls.Add(btnGuardar);
|
||||
Controls.Add(btnAñadir);
|
||||
Controls.Add(txtEmailTargetAdd);
|
||||
Controls.Add(txtEmailPass);
|
||||
Controls.Add(txtEmailAddr);
|
||||
Controls.Add(dgvEmailTarget);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label1);
|
||||
Name = "FrmInforme";
|
||||
Text = "Informes";
|
||||
WindowState = FormWindowState.Maximized;
|
||||
((System.ComponentModel.ISupportInitialize)dgvEmailTarget).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label label1;
|
||||
private Label label2;
|
||||
private Label label3;
|
||||
private DataGridView dgvEmailTarget;
|
||||
private TextBox txtEmailAddr;
|
||||
private TextBox txtEmailPass;
|
||||
private TextBox txtEmailTargetAdd;
|
||||
private Button btnAñadir;
|
||||
private Button btnGuardar;
|
||||
private Button btnEliminar;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using Informes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -12,9 +14,90 @@ namespace Vista
|
||||
{
|
||||
public partial class FrmInforme : Form
|
||||
{
|
||||
const string configpath = "settings.json";
|
||||
public FrmInforme()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (!File.Exists(configpath))
|
||||
{
|
||||
string json = JsonSerializer.Serialize(new ConfigEmail { EmailAddr = "", EmailPass = "", EmailTarget = new List<String>() }, new JsonSerializerOptions { WriteIndented = true });
|
||||
File.WriteAllText(configpath, json);
|
||||
}
|
||||
|
||||
string jsonString = File.ReadAllText(configpath);
|
||||
ConfigEmail config = JsonSerializer.Deserialize<ConfigEmail>(jsonString);
|
||||
CargaDatos(config);
|
||||
}
|
||||
|
||||
private void CargaDatos(ConfigEmail ce)
|
||||
{
|
||||
txtEmailAddr.Text = ce.EmailAddr;
|
||||
txtEmailPass.Text = ce.EmailPass;
|
||||
|
||||
dgvEmailTarget.DataSource = null;
|
||||
dgvEmailTarget.Columns.Add("EmailTarget", "EmailTarget");
|
||||
|
||||
// Agregar los datos al DataGridView
|
||||
foreach (var str in ce.EmailTarget)
|
||||
{
|
||||
dgvEmailTarget.Rows.Add(str);
|
||||
}
|
||||
}
|
||||
private void btnGuardar_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<string> emailTarget = new List<string>();
|
||||
|
||||
foreach (DataGridViewRow row in dgvEmailTarget.Rows)
|
||||
{
|
||||
if (row.Cells["EmailTarget"].Value != null)
|
||||
{
|
||||
emailTarget.Add(row.Cells["EmailTarget"].Value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
ConfigEmail config = new ConfigEmail
|
||||
{
|
||||
EmailAddr = txtEmailAddr.Text,
|
||||
EmailPass = txtEmailPass.Text,
|
||||
EmailTarget = emailTarget
|
||||
};
|
||||
|
||||
string json = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
||||
File.WriteAllText(configpath, json);
|
||||
}
|
||||
|
||||
private void btnAñadir_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<string> emailTarget = new List<string>();
|
||||
emailTarget.Add(txtEmailTargetAdd.Text);
|
||||
foreach (DataGridViewRow row in dgvEmailTarget.Rows)
|
||||
{
|
||||
if (row.Cells["EmailTarget"].Value != null)
|
||||
{
|
||||
emailTarget.Add(row.Cells["EmailTarget"].Value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
// Agregar los datos al DataGridView
|
||||
dgvEmailTarget.Rows.Add(txtEmailTargetAdd.Text);
|
||||
}
|
||||
|
||||
private void btnEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (dgvEmailTarget.SelectedRows.Count > 0)
|
||||
{
|
||||
// Elimina la fila seleccionada
|
||||
dgvEmailTarget.Rows.RemoveAt(dgvEmailTarget.SelectedRows[0].Index);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Por favor, selecciona una fila para eliminar EmailTarget.");
|
||||
}
|
||||
}
|
||||
catch (Exception) { throw; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Controladora\Controladora.csproj" />
|
||||
<ProjectReference Include="..\Entidades\Entidades.csproj" />
|
||||
<ProjectReference Include="..\Informes\Informes.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -152,6 +152,66 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj",
|
||||
"projectName": "Informes",
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj",
|
||||
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"https://api.nuget.org/v3/index.json": {},
|
||||
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Modelo\\Modelo.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
@@ -531,7 +591,13 @@
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj"
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 6092f6f (cambios nachito a form factura)
|
||||
=======
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj"
|
||||
>>>>>>> 5479db7 (terminado form de config)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5475,6 +5475,19 @@
|
||||
=======
|
||||
>>>>>>> 51676e6 (feat: Cambios Varios (mirar Desc))
|
||||
},
|
||||
"Informes/1.0.0": {
|
||||
"type": "project",
|
||||
"framework": ".NETCoreApp,Version=v6.0",
|
||||
"dependencies": {
|
||||
"Entidades": "1.0.0"
|
||||
},
|
||||
"compile": {
|
||||
"bin/placeholder/Informes.dll": {}
|
||||
},
|
||||
"runtime": {
|
||||
"bin/placeholder/Informes.dll": {}
|
||||
}
|
||||
},
|
||||
"Modelo/1.0.0": {
|
||||
"type": "project",
|
||||
"framework": ".NETCoreApp,Version=v6.0",
|
||||
@@ -13511,6 +13524,11 @@
|
||||
=======
|
||||
>>>>>>> 51676e6 (feat: Cambios Varios (mirar Desc))
|
||||
},
|
||||
"Informes/1.0.0": {
|
||||
"type": "project",
|
||||
"path": "../Informes/Informes.csproj",
|
||||
"msbuildProject": "../Informes/Informes.csproj"
|
||||
},
|
||||
"Modelo/1.0.0": {
|
||||
"type": "project",
|
||||
"path": "../Modelo/Modelo.csproj",
|
||||
@@ -13527,12 +13545,17 @@
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
"Controladora >= 1.0.0",
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 8ad9dc6 (faltan controladoras)
|
||||
=======
|
||||
"Controladora >= 1.0.0",
|
||||
>>>>>>> 51676e6 (feat: Cambios Varios (mirar Desc))
|
||||
"Entidades >= 1.0.0"
|
||||
=======
|
||||
"Entidades >= 1.0.0",
|
||||
"Informes >= 1.0.0"
|
||||
>>>>>>> 5479db7 (terminado form de config)
|
||||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
@@ -13643,7 +13666,13 @@
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj"
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 6092f6f (cambios nachito a form factura)
|
||||
=======
|
||||
},
|
||||
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj": {
|
||||
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj"
|
||||
>>>>>>> 5479db7 (terminado form de config)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
"dgSpecHash": "NrgVcMaE+xOpA8UnmFhQwGflGRDAICnz8EffGQ+5vJrqniVecS26UDqJMYcJ2SmlijA3PT49NDmcrKADdBbkcQ==",
|
||||
"success": true,
|
||||
@@ -617,6 +618,9 @@
|
||||
=======
|
||||
"dgSpecHash": "WPBgDz5Ag7uyUpIln8eBMvu2+XqGSiWG0TNaL6A9IRZAEDYpI2SXVE367iYE3zDP7SrxjO4nhM2wKkdjx8Psbw==",
|
||||
>>>>>>> 6092f6f (cambios nachito a form factura)
|
||||
=======
|
||||
"dgSpecHash": "HaKkXKrDu+gimYBODDKQ5E1ZL1m4YoG9CrkcmpZyBjOtEmifQPEVkmmKOyOtFgPNaLHFACDybW6TDfmls/Ua8g==",
|
||||
>>>>>>> 5479db7 (terminado form de config)
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Vista\\Vista.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
|
||||
Reference in New Issue
Block a user