示例#1
0
        /// <summary>
        /// Guarda la informacion del formulario en GIT_Config_Logica
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                using (var context = new Profit_RGEntities())
                {
                    Boolean buscar98 = false;
                    //  Boolean buscar90 = false;

                    foreach (var item in CLO)
                    {
                        buscar98 = context.pConf_LogicaDGV(activo).Count(u => u.Rowguid.ToString().ToUpper() == item.Rowguid.ToUpper()) > 0;
                        // buscar90 = context.pSeleccionarGIT_Asign_Equipo(item.activo.Trim ()).Count(u => u.Rowguid.ToString () == item.Rowguid.ToUpper ()) > 0;
                        if (buscar98)
                        {
                            context.pGIT_Config_LogicaActualizar(radTxt_activo.Text, item.campo, item.descripcion, Guid.Parse(item.Rowguid));
                        }
                        else
                        {
                            context.pGIT_Config_LogicaInsertar(radTxt_activo.Text, item.campo, item.descripcion);
                        }
                    }
                }
                MessageBox.Show(this, "Se ha guardado la información satisfactoriamente.", "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            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);
            }
        }