Example #1
0
        private void miHistorialDeComprasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WindowsFormsApplication1.Historial_Cliente.Form1 frm = new WindowsFormsApplication1.Historial_Cliente.Form1(this.txtIdUsuario.Text, false);

            //TextBox txt = (TextBox)frm.Controls.Find("txtIdUsuario", true)[0];
            //txt.Text = this.txtIdUsuario.Text;
            //MessageBox.Show(this.txtIdUsuario.Text);
            frm.Show();
        }
Example #2
0
 private void calificarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WindowsFormsApplication1.Historial_Cliente.Form1 frm = new WindowsFormsApplication1.Historial_Cliente.Form1(this.txtIdUsuario.Text, true);
     frm.Show();
 }
Example #3
0
        private void btCalificar_Click(object sender, EventArgs e)
        {
            if (String.Compare(this.txtDesc.Text, "") != 0)
            {
                if ((!this.txtDesc.Text.All(c => Char.IsLetterOrDigit(c) || c == ' ' || Char.IsWhiteSpace(c))))
                {
                    MessageBox.Show("La descripcion puede ir vacia, o solo con letras del abecedario y numeros..");
                    return;
                }
            }

            /*
             * if (this.combEstrellas.SelectedValue == null)
             * {
             *  MessageBox.Show("Por favor califique de 1 a 5 estrellas..");
             *  return;
             * }*/

            if (!((String.Compare(this.combEstrellas.SelectedIndex.ToString(), "0") == 0) || (String.Compare(this.combEstrellas.SelectedIndex.ToString(), "1") == 0) || (String.Compare(this.combEstrellas.SelectedIndex.ToString(), "2") == 0) || (String.Compare(this.combEstrellas.SelectedIndex.ToString(), "3") == 0) || (String.Compare(this.combEstrellas.SelectedIndex.ToString(), "4") == 0)))
            {
                MessageBox.Show("Por favor califique de 1 a 5 estrellas..");
                return;
            }

            DataTable    resultado2 = new DataTable();
            _conexionSQL conectarBD = _conexionSQL.Instance;
            string       sql;

            if (String.Compare(this.txtEsCompraDirecta.Text, "0") == 0)   //es una subasta
            {
                sql        = @"EXEC DALE_SA.pr_CalificarSubasta 
                            '" + this.txtIdPublicacion.Text + @"',
                            '" + this.txtIdCompra.Text + @"',
                            '" + ((this.combEstrellas.SelectedIndex) + 1).ToString() + @"',
                            '" + this.txtDesc.Text + @"'
                        ";
                resultado2 = conectarBD.ejecutarUnaQuery(sql);
                if (resultado2 != null)
                {
                    //if (resultado2.Rows[0][0].Equals(1))
                    //{
                    MessageBox.Show("Calificacion Exitosa");
                    //}
                    //else
                    //{
                    //    MessageBox.Show("No se pudo calificar.. reintente");
                    //    return;
                    //}
                }
                else
                {
                    MessageBox.Show("No se pudo calificar.. reintente");
                    return;
                }
            }

            if (String.Compare(this.txtEsCompraDirecta.Text, "1") == 0)   //es compra directa
            {
                sql        = @"EXEC DALE_SA.pr_CalificarCompraInmediata
                            '" + this.txtIdPublicacion.Text + @"',
                            '" + this.txtIdCompra.Text + @"',
                            '" + ((this.combEstrellas.SelectedIndex) + 1).ToString() + @"',
                            '" + this.txtDesc.Text + @"'
                        ";
                resultado2 = conectarBD.ejecutarUnaQuery(sql);
                if (resultado2 != null)
                {
                    //if (resultado2.Rows[0][0].Equals(1))
                    //{
                    MessageBox.Show("Calificacion Exitosa");
                    //}
                    //else
                    //{
                    //   MessageBox.Show("No se pudo calificar.. reintente");
                    //   return;
                    //}
                }
                else
                {
                    MessageBox.Show("No se pudo calificar.. reintente");
                    return;
                }
            }


            //elimino los formularios abiertos de historial de cliente y lo actualizo..
            for (int i = Application.OpenForms.Count - 1; i >= 0; i--)
            {
                if (Application.OpenForms[i].Text == "Mi Historial de Compras")
                {
                    Application.OpenForms[i].Close();
                }
            }

            WindowsFormsApplication1.Historial_Cliente.Form1 frm = new WindowsFormsApplication1.Historial_Cliente.Form1(resultado2.Rows[0][0].ToString(), true);
            frm.Show();
            this.btCancelar.PerformClick(); //salimos...
        }