Exemple #1
0
 public Cajas(DetalleControl padre, int idCotizacion)
 {
     InitializeComponent();
     this.padre        = padre;
     this.idCotizacion = idCotizacion;
     detalleCotizacion = BD.ConsultaCotizacionById(this.idCotizacion);
 }
Exemple #2
0
        private void AgregarPropiedades(Button btn, string id, string razonsocial, string fecha, string pedido, string estado)
        {
            btn.Name = "btn" + fecha;
            //Color color = System.Drawing.ColorTranslator.FromHtml("#C2E8F0");
            Color color = Color.Black;

            btn.BackColor = color;
            btn.Font      = new Font("Microsoft Sans Serif", 11, FontStyle.Bold);
            btn.ForeColor = Color.White;
            btn.Size      = new Size(220, 150);
            btn.Location  = new Point(1, 1);
            string cadena = fecha;

            string resultado = cadena.Substring(0, 10);

            btn.Text      = "Cotización " + id + "\n " + razonsocial + "\n " + resultado + " \n Pedido " + pedido + " \n " + estado;
            btn.TextAlign = ContentAlignment.MiddleCenter;
            btn.Click    += (s, e) => {
                timer1.Stop();
                if (tipo_usuario.Equals("VENDEDOR"))
                {
                }
                else
                {
                    string fechaM = "";
                    int    dia    = Convert.ToInt32(t.Day);
                    if (dia < 10 && Convert.ToInt32(t.Month) >= 10)
                    {
                        fechaM = t.Year + "-" + t.Month + "-" + "0" + t.Day;
                    }
                    if (t.Day < 10 && t.Month < 10)
                    {
                        fechaM = t.Year + "-" + "0" + t.Month + "-" + "0" + t.Day;
                    }
                    if (t.Day >= 10 && t.Month < 10)
                    {
                        fechaM = t.Year + "-" + "0" + t.Month + "-" + t.Day;
                    }
                    if (t.Day >= 10 && t.Month >= 10)
                    {
                        fechaM = t.Year + "-" + t.Month + "-" + t.Day;
                    }

                    DetalleControl form = new DetalleControl(this, Convert.ToInt32(id), fechaM);
                    form.Show();
                    this.Enabled = false;
                }
            };
        }