diff --git a/Principal/MenuPrincipal.Designer.cs b/Principal/MenuPrincipal.Designer.cs index 3157897..d692ab3 100644 --- a/Principal/MenuPrincipal.Designer.cs +++ b/Principal/MenuPrincipal.Designer.cs @@ -32,6 +32,7 @@ this.panel1 = new System.Windows.Forms.Panel(); this.lblfecha = 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.panel2 = new System.Windows.Forms.Panel(); this.pictureBox7 = new System.Windows.Forms.PictureBox(); @@ -45,7 +46,6 @@ this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = 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.flowLayoutPanel1.SuspendLayout(); this.panel2.SuspendLayout(); @@ -74,7 +74,7 @@ this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); 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.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint); // @@ -103,6 +103,11 @@ this.lblhora.Text = "label1"; this.lblhora.Click += new System.EventHandler(this.lblhora_Click); // + // horafecha + // + this.horafecha.Enabled = true; + this.horafecha.Tick += new System.EventHandler(this.horafecha_Tick); + // // flowLayoutPanel1 // this.flowLayoutPanel1.BackgroundImage = global::compabetov2.Properties.Resources.rec; @@ -193,6 +198,7 @@ this.button3.TabIndex = 10; this.button3.Text = "Productos"; this.button3.UseVisualStyleBackColor = false; + this.button3.Click += new System.EventHandler(this.button3_Click); // // button5 // @@ -285,20 +291,15 @@ this.pictureBox1.TabStop = false; this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); // - // horafecha - // - this.horafecha.Enabled = true; - this.horafecha.Tick += new System.EventHandler(this.horafecha_Tick); - // // MenuPrincipal // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 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.Controls.Add(this.panel1); 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.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.MenuPrincipal_Load); diff --git a/Principal/MenuPrincipal.cs b/Principal/MenuPrincipal.cs index 7655fdd..a17b5b2 100644 --- a/Principal/MenuPrincipal.cs +++ b/Principal/MenuPrincipal.cs @@ -1,4 +1,5 @@ -using compabetov2.database; +using compabetov2.admin; +using compabetov2.database; using compabetov2.database.modelos; using System; using System.Collections.Generic; @@ -22,6 +23,7 @@ namespace compabetov2 { private int childFormNumber = 0; private LoginModel loginPrincipal; + public MenuPrincipal(LoginModel loginPrincipal) { 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(); + + } + } } } diff --git a/admin/crud.Designer.cs b/admin/crud.Designer.cs new file mode 100644 index 0000000..cb69b2a --- /dev/null +++ b/admin/crud.Designer.cs @@ -0,0 +1,181 @@ +namespace compabetov2.admin +{ + partial class crud + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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; + } +} \ No newline at end of file diff --git a/admin/crud.cs b/admin/crud.cs new file mode 100644 index 0000000..1960683 --- /dev/null +++ b/admin/crud.cs @@ -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().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(); + } + } + } +} diff --git a/admin/crud.resx b/admin/crud.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/admin/crud.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/bin/Debug/compabetov2.exe b/bin/Debug/compabetov2.exe index df18aa2..df805f7 100644 Binary files a/bin/Debug/compabetov2.exe and b/bin/Debug/compabetov2.exe differ diff --git a/bin/Debug/compabetov2.pdb b/bin/Debug/compabetov2.pdb index 70cf87a..d132ae6 100644 Binary files a/bin/Debug/compabetov2.pdb and b/bin/Debug/compabetov2.pdb differ diff --git a/compabetov2.csproj b/compabetov2.csproj index 191ef8d..4385495 100644 --- a/compabetov2.csproj +++ b/compabetov2.csproj @@ -106,6 +106,12 @@ + + Form + + + crud.cs + @@ -274,6 +280,9 @@ verMerma.cs + + crud.cs + AgregarEmpleado1.cs diff --git a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache index fc2c8f9..e3e6d75 100644 --- a/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache +++ b/obj/Debug/compabetov2.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -589875dc9085d077e48293cb909f4ec97a14e8901c3e585e6068a4b13e6e810b +057a07ff8f8a6f35d17720e1156a8cbeaa37ba3ef371419afc7a5a193cc76c5e diff --git a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt index 2ed2a54..95eced6 100644 --- a/obj/Debug/compabetov2.csproj.FileListAbsolute.txt +++ b/obj/Debug/compabetov2.csproj.FileListAbsolute.txt @@ -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\compabetov2.exe C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.pdb +C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.crud.resources diff --git a/obj/Debug/compabetov2.csproj.GenerateResource.cache b/obj/Debug/compabetov2.csproj.GenerateResource.cache index 8077c86..d9419a1 100644 Binary files a/obj/Debug/compabetov2.csproj.GenerateResource.cache and b/obj/Debug/compabetov2.csproj.GenerateResource.cache differ diff --git a/obj/Debug/compabetov2.exe b/obj/Debug/compabetov2.exe index df18aa2..df805f7 100644 Binary files a/obj/Debug/compabetov2.exe and b/obj/Debug/compabetov2.exe differ diff --git a/obj/Debug/compabetov2.pdb b/obj/Debug/compabetov2.pdb index 70cf87a..d132ae6 100644 Binary files a/obj/Debug/compabetov2.pdb and b/obj/Debug/compabetov2.pdb differ