Se agrega el form de crud

This commit is contained in:
Michael Robles
2024-06-18 17:06:47 -07:00
parent cee20a613f
commit 5f6b020f61
13 changed files with 394 additions and 11 deletions
+10 -9
View File
@@ -32,6 +32,7 @@
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.lblfecha = new System.Windows.Forms.Label(); this.lblfecha = new System.Windows.Forms.Label();
this.lblhora = new System.Windows.Forms.Label(); this.lblhora = new System.Windows.Forms.Label();
this.horafecha = new System.Windows.Forms.Timer(this.components);
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.pictureBox7 = new System.Windows.Forms.PictureBox(); this.pictureBox7 = new System.Windows.Forms.PictureBox();
@@ -45,7 +46,6 @@
this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.horafecha = new System.Windows.Forms.Timer(this.components);
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
@@ -74,7 +74,7 @@
this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1677, 772); this.panel1.Size = new System.Drawing.Size(1924, 1059);
this.panel1.TabIndex = 4; this.panel1.TabIndex = 4;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint); this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
// //
@@ -103,6 +103,11 @@
this.lblhora.Text = "label1"; this.lblhora.Text = "label1";
this.lblhora.Click += new System.EventHandler(this.lblhora_Click); this.lblhora.Click += new System.EventHandler(this.lblhora_Click);
// //
// horafecha
//
this.horafecha.Enabled = true;
this.horafecha.Tick += new System.EventHandler(this.horafecha_Tick);
//
// flowLayoutPanel1 // flowLayoutPanel1
// //
this.flowLayoutPanel1.BackgroundImage = global::compabetov2.Properties.Resources.rec; this.flowLayoutPanel1.BackgroundImage = global::compabetov2.Properties.Resources.rec;
@@ -193,6 +198,7 @@
this.button3.TabIndex = 10; this.button3.TabIndex = 10;
this.button3.Text = "Productos"; this.button3.Text = "Productos";
this.button3.UseVisualStyleBackColor = false; this.button3.UseVisualStyleBackColor = false;
this.button3.Click += new System.EventHandler(this.button3_Click);
// //
// button5 // button5
// //
@@ -285,20 +291,15 @@
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
// //
// horafecha
//
this.horafecha.Enabled = true;
this.horafecha.Tick += new System.EventHandler(this.horafecha_Tick);
//
// MenuPrincipal // MenuPrincipal
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1677, 772); this.ClientSize = new System.Drawing.Size(1924, 1059);
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
this.IsMdiContainer = true; this.IsMdiContainer = true;
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "MenuPrincipal"; this.Name = "MenuPrincipal";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.MenuPrincipal_Load); this.Load += new System.EventHandler(this.MenuPrincipal_Load);
+17 -1
View File
@@ -1,4 +1,5 @@
using compabetov2.database; using compabetov2.admin;
using compabetov2.database;
using compabetov2.database.modelos; using compabetov2.database.modelos;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -22,6 +23,7 @@ namespace compabetov2
{ {
private int childFormNumber = 0; private int childFormNumber = 0;
private LoginModel loginPrincipal; private LoginModel loginPrincipal;
public MenuPrincipal(LoginModel loginPrincipal) public MenuPrincipal(LoginModel loginPrincipal)
{ {
InitializeComponent(); InitializeComponent();
@@ -195,5 +197,19 @@ namespace compabetov2
} }
private void button3_Click(object sender, EventArgs e)
{
if (loginPrincipal.tipo.Equals("empleado"))
{
MessageBox.Show("Usted no tiene permisos de acceder a este apartado");
}
else
{
crud crud = new crud();
crud.Owner = this;
crud.Show();
}
}
} }
} }
+181
View File
@@ -0,0 +1,181 @@
namespace compabetov2.admin
{
partial class crud
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.panel2 = new System.Windows.Forms.Panel();
this.pictureBox7 = new System.Windows.Forms.PictureBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.flowLayoutPanel1.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
this.SuspendLayout();
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.BackgroundImage = global::compabetov2.Properties.Resources.rec;
this.flowLayoutPanel1.Controls.Add(this.panel2);
this.flowLayoutPanel1.Controls.Add(this.button1);
this.flowLayoutPanel1.Controls.Add(this.button2);
this.flowLayoutPanel1.Controls.Add(this.button3);
this.flowLayoutPanel1.Controls.Add(this.button5);
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, -1);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(324, 1061);
this.flowLayoutPanel1.TabIndex = 8;
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.Transparent;
this.panel2.Controls.Add(this.pictureBox7);
this.panel2.Location = new System.Drawing.Point(3, 2);
this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(312, 263);
this.panel2.TabIndex = 8;
//
// pictureBox7
//
this.pictureBox7.Image = global::compabetov2.Properties.Resources.HomeroMenu;
this.pictureBox7.Location = new System.Drawing.Point(64, 34);
this.pictureBox7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.pictureBox7.Name = "pictureBox7";
this.pictureBox7.Size = new System.Drawing.Size(190, 197);
this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBox7.TabIndex = 8;
this.pictureBox7.TabStop = false;
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.FlatAppearance.BorderSize = 0;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button1.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button1.Image = global::compabetov2.Properties.Resources.Menui1;
this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button1.Location = new System.Drawing.Point(3, 269);
this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button1.Name = "button1";
this.button1.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0);
this.button1.Size = new System.Drawing.Size(312, 114);
this.button1.TabIndex = 8;
this.button1.Text = "Menú";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.BackColor = System.Drawing.Color.Transparent;
this.button2.FlatAppearance.BorderSize = 0;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button2.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button2.Image = global::compabetov2.Properties.Resources.estadisticasi;
this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button2.Location = new System.Drawing.Point(3, 387);
this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button2.Name = "button2";
this.button2.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0);
this.button2.Size = new System.Drawing.Size(312, 114);
this.button2.TabIndex = 9;
this.button2.Text = "Reportes";
this.button2.UseVisualStyleBackColor = false;
//
// button3
//
this.button3.BackColor = System.Drawing.Color.Transparent;
this.button3.FlatAppearance.BorderSize = 0;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button3.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button3.Image = global::compabetov2.Properties.Resources.productoi;
this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button3.Location = new System.Drawing.Point(3, 505);
this.button3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button3.Name = "button3";
this.button3.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0);
this.button3.Size = new System.Drawing.Size(312, 114);
this.button3.TabIndex = 10;
this.button3.Text = "Productos";
this.button3.UseVisualStyleBackColor = false;
//
// button5
//
this.button5.BackColor = System.Drawing.Color.Transparent;
this.button5.FlatAppearance.BorderSize = 0;
this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.button5.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button5.Image = global::compabetov2.Properties.Resources.sesionc;
this.button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button5.Location = new System.Drawing.Point(3, 623);
this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button5.Name = "button5";
this.button5.Padding = new System.Windows.Forms.Padding(51, 0, 0, 0);
this.button5.Size = new System.Drawing.Size(312, 114);
this.button5.TabIndex = 12;
this.button5.Text = "Salir";
this.button5.UseVisualStyleBackColor = false;
//
// crud
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1677, 1037);
this.ControlBox = false;
this.Controls.Add(this.flowLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "crud";
this.ShowIcon = false;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.crud_Load);
this.flowLayoutPanel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.PictureBox pictureBox7;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button5;
}
}
+55
View File
@@ -0,0 +1,55 @@
using compabetov2.database.modelos;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace compabetov2.admin
{
public partial class crud : Form
{
private LoginModel loginPrincipal;
public crud()
{
InitializeComponent();
}
private void crud_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
// Cerrar el formulario de ventas
this.Close();
// Verificar si ya hay una instancia del formulario principal
MenuPrincipal menuprincipalForm = Application.OpenForms.OfType<MenuPrincipal>().FirstOrDefault();
if (menuprincipalForm == null)
{
// Si no hay una instancia, crear una nueva
menuprincipalForm = new MenuPrincipal(loginPrincipal);
// Establecer el formulario principal como el formulario MDI padre
menuprincipalForm.MdiParent = this.MdiParent;
// Mostrar el formulario principal
menuprincipalForm.Show();
}
else
{
// Si ya hay una instancia, simplemente llevarlo al frente
menuprincipalForm.BringToFront();
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<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="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
Binary file not shown.
Binary file not shown.
+9
View File
@@ -106,6 +106,12 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="admin\crud.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="admin\crud.Designer.cs">
<DependentUpon>crud.cs</DependentUpon>
</Compile>
<Compile Include="database\modelos\DetalleEnvioModel.cs" /> <Compile Include="database\modelos\DetalleEnvioModel.cs" />
<Compile Include="database\modelos\DetalleImporte.cs" /> <Compile Include="database\modelos\DetalleImporte.cs" />
<Compile Include="database\modelos\DetalleImporteCuenta.cs" /> <Compile Include="database\modelos\DetalleImporteCuenta.cs" />
@@ -274,6 +280,9 @@
<Compile Include="Merma\verMerma.Designer.cs"> <Compile Include="Merma\verMerma.Designer.cs">
<DependentUpon>verMerma.cs</DependentUpon> <DependentUpon>verMerma.cs</DependentUpon>
</Compile> </Compile>
<EmbeddedResource Include="admin\crud.resx">
<DependentUpon>crud.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Empleados\AgregarEmpleado1.resx"> <EmbeddedResource Include="Empleados\AgregarEmpleado1.resx">
<DependentUpon>AgregarEmpleado1.cs</DependentUpon> <DependentUpon>AgregarEmpleado1.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -1 +1 @@
589875dc9085d077e48293cb909f4ec97a14e8901c3e585e6068a4b13e6e810b 057a07ff8f8a6f35d17720e1156a8cbeaa37ba3ef371419afc7a5a193cc76c5e
@@ -149,3 +149,4 @@ C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.a
C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabet.5C4A9C0C.Up2Date C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabet.5C4A9C0C.Up2Date
C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.exe C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.exe
C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.pdb C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.pdb
C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.crud.resources
Binary file not shown.
Binary file not shown.
Binary file not shown.