Example #1
0
        private void btn_confirm_Click(object sender, EventArgs e)
        {
            try

            {
                using (Profit_RGEntities context = new Profit_RGEntities())
                {
                    //SpeechSynthesizer hello = new SpeechSynthesizer();
                    //hello.Speak ("Hello Jesus");



                    if ((MessageBox.Show(this, "Desea confirmar la Autorizacion?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes))
                    {
                        Int32 i = 0;
                        foreach (DataGridViewRow item in grdSalida.Rows)
                        {
                            // (grdSalida[7, i].Value.ToString() == "S")
                            string a = Convert.ToString(item.Cells["checkin"].Value);

                            if (a == "T")
                            {
                                context.pConfirmarFecha_pcp(Convert.ToInt32(grdSalida.Rows[i].Cells[0].Value));
                                //grdSalida.DataSource = "";
                                // CargarSalidas();
                            }
                            else
                            {
                            }

                            // CargarSalidas();

                            i++;
                        }
                        grdSalida.DataSource = "";
                        CargarSalidas();
                        Refrescar();
                    }
                    else
                    {
                        DialogResult = DialogResult.None;
                    }
                }
            }
            catch (EntityException ex)
            {
                MessageBox.Show(ex.InnerException.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex1)
            {
                MessageBox.Show(ex1.Message, "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }