Esempio n. 1
0
        private void Cancelar(GridCommandEventArgs e)
        {
            try
            {
                GridItem       item        = e.Item;
                string         Conexion    = System.Configuration.ConfigurationManager.AppSettings["strConnectionCentral"];
                Sesion         sesion      = (Sesion)Session["Sesion" + Session.SessionID];
                SolConvenioDet sol         = new SolConvenioDet();
                CN_Convenio    cn_conv     = new CN_Convenio();
                int            Verificador = 0;
                sol.Id_Sol   = int.Parse(this.rgVinculados.MasterTableView.Items[e.Item.ItemIndex]["Id_Sol"].Text);
                sol.Id_PC    = int.Parse(this.rgVinculados.MasterTableView.Items[e.Item.ItemIndex]["Id_PC"].Text);
                sol.Id_Cte   = int.Parse(this.rgVinculados.MasterTableView.Items[e.Item.ItemIndex]["Id_Cte"].Text);
                sol.U_Nombre = sesion.U_Nombre;
                cn_conv.Convenio_DesvinculaUno(sol, ref Verificador, Conexion);


                if (Verificador == -1)
                {
                    cn_conv.ConvenioDesvinculo_EnviarCorreo(sol, sesion.Emp_Cnx);
                    Alerta("Se desvínculo el cliente de manera exitosa");
                    rgVinculados.Rebind();
                }
                else
                {
                    Alerta("Error al tratar de desvincular al cliente");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public void ConvenioSolicitud_ConsultaDetAt(int Id_Sol, ref List <SolConvenioDet> List, string Conexion)
        {
            try
            {
                CD_Datos      cd_datos = new CD_Datos(Conexion);
                SqlDataReader dr       = null;

                string[] Parametros = { "@Id_Sol" };
                object[] Valores    = { Id_Sol };

                SqlCommand sqlcmd = cd_datos.GenerarSqlCommand("spProPrecioConv_SolicitudConsultaDetAt", ref dr, Parametros, Valores);

                SolConvenioDet sol;
                while (dr.Read())
                {
                    sol               = new SolConvenioDet();
                    sol.Id_Cte        = Convert.ToInt32(dr["Id_Cte"]);
                    sol.Sol_CteNombre = dr["Sol_CteNombre"].ToString();
                    sol.Sol_UsuFinal  = dr["Sol_UsuFinal"].ToString();
                    sol.SolD_Estatus  = dr["SolD_Estatus"].ToString();
                    sol.Id_Ter        = Convert.ToInt32(dr["Id_Ter"]);
                    sol.SolTer_Nombre = dr["SolTer_Nombre"].ToString();
                    List.Add(sol);
                }

                cd_datos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
        private void Modificar(GridCommandEventArgs e)
        {
            try
            {
                GridItem gi = e.Item;

                if (HFCapUsuario.Value == "False")
                {
                    if (((RadNumericTextBox)gi.FindControl("TxtId_Cte")).Text == "" ||
                        ((RadTextBox)gi.FindControl("TxtSol_CteNombre")).Text == "")
                    {
                        Alerta("Todos los campos son requeridos");
                        e.Canceled = true;
                        return;
                    }
                }
                else
                {
                    if (((RadNumericTextBox)gi.FindControl("TxtId_Cte")).Text == "" ||
                        ((RadTextBox)gi.FindControl("TxtSol_CteNombre")).Text == "" ||
                        ((RadTextBox)gi.FindControl("TxtSol_UsuFinal")).Text == "")
                    {
                        Alerta("Todos los campos son requeridos");
                        e.Canceled = true;
                        return;
                    }
                }



                SolConvenioDet s = new SolConvenioDet();
                s.Id_Cte        = int.Parse(((RadNumericTextBox)gi.FindControl("TxtId_Cte")).Text);
                s.Sol_CteNombre = ((RadTextBox)gi.FindControl("TxtSol_CteNombre")).Text.Trim();
                s.Sol_UsuFinal  = ((RadTextBox)gi.FindControl("TxtSol_UsuFinal")).Text.Trim();
                s.Id_Unique     = ((Label)gi.FindControl("LblId_UniqueE")).Text.Trim();
                s.Id_Ter        = int.Parse(((RadNumericTextBox)gi.FindControl("TxtId_Ter")).Text);
                s.SolTer_Nombre = ((RadTextBox)gi.FindControl("TxtSolTer_Nombre")).Text.Trim();

                //if (ListDet.Where(x => x.Id_Cte == s.Id_Cte).ToList().Count > 0)
                //{
                //    Alerta("El cliente ya fue agregado");
                //    e.Canceled = true;
                //    return;
                //}

                ListDet.Where(x => x.Id_Unique == s.Id_Unique).ToList()[0].Id_Cte        = s.Id_Cte;
                ListDet.Where(x => x.Id_Unique == s.Id_Unique).ToList()[0].Sol_CteNombre = s.Sol_CteNombre;
                ListDet.Where(x => x.Id_Unique == s.Id_Unique).ToList()[0].Sol_UsuFinal  = s.Sol_UsuFinal;
                ListDet.Where(x => x.Id_Unique == s.Id_Unique).ToList()[0].Id_Ter        = s.Id_Ter;
                ListDet.Where(x => x.Id_Unique == s.Id_Unique).ToList()[0].SolTer_Nombre = s.SolTer_Nombre;


                rgSolicitudDet.Rebind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void Guardar()
        {
            try
            {
                string Conexion            = System.Configuration.ConfigurationManager.AppSettings["strConnectionCentral"];
                Sesion sesion              = (Sesion)Session["Sesion" + Session.SessionID];
                List <SolConvenioDet> List = new List <SolConvenioDet>();
                SolConvenioDet        s;
                foreach (GridDataItem item in this.rgSolicitudDet.MasterTableView.Items)
                {
                    s               = new SolConvenioDet();
                    s.Id_Sol        = int.Parse(LblId_Sol.Text);
                    s.Id_Cte        = int.Parse(item["Id_Cte"].Text);
                    s.Sol_CteNombre = item["Sol_CteNombre"].Text;
                    if ((item["Rechazado"].FindControl("chkRechazar") as CheckBox).Checked == true)
                    {
                        s.SolD_Estatus = "R";
                    }
                    else if ((item["Autorizar"].FindControl("chkAutorizar") as CheckBox).Checked == true)
                    {
                        s.SolD_Estatus = "A";
                    }
                    else
                    {
                        Alerta("Debe seleccionar una opcion para el cliente <b>" + s.Id_Cte.ToString() + "-" + s.Sol_CteNombre + "</b>");
                        return;
                    }


                    List.Add(s);
                }
                int         Id_Sol      = int.Parse(LblId_Sol.Text);
                int         Verificador = 0;
                CN_Convenio cn_conv     = new CN_Convenio();

                cn_conv.ConvenioSolicitud_Atender(Id_Sol, List, ref Verificador, Conexion);

                if (Verificador == -1)
                {
                    cn_conv.ConvenioSolicitud_EnviarCorreoAtendio(Id_Sol, ref Verificador, sesion.Emp_Cnx);
                    //string script = "<script>RefreshParentPage()</" + "script>";
                    //ScriptManager.RegisterStartupScript(this, this.GetType(), "RefreshParentPage", script, false);
                    AlertaCerrar("Se ha atendido la solicitud de manera exitosa");
                }
                else
                {
                    Alerta("Alerta al tratar de atender la solicitud");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
 protected void rgSolicitudDet_InsertCommand(object source, GridCommandEventArgs e)
 {
     try
     {
         GridEditableItem editedItem = e.Item as GridEditableItem;
         SolConvenioDet   c          = new SolConvenioDet();
     }
     catch (Exception ex)
     {
         ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
     }
 }
Esempio n. 6
0
 public void ConvenioDesvinculo_EnviarCorreo(SolConvenioDet sol, string Conexion)
 {
     try
     {
         CD_Convenio cd_conv = new CD_Convenio();
         cd_conv.ConvenioDesvinculo_EnviarCorreo(sol, Conexion);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 7
0
 public void Convenio_DesvinculaUno(SolConvenioDet sol, ref int Verificador, string Conexion)
 {
     try
     {
         CD_Convenio cd_conv = new CD_Convenio();
         cd_conv.Convenio_DesvinculaUno(sol, ref Verificador, Conexion);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 8
0
        public void Convenio_DesvinculaUno(SolConvenioDet sol, ref int Verificador, string Conexion)
        {
            try
            {
                CD_Datos cd_datos = new CD_Datos(Conexion);

                string[] Parametros = { "@Id_Sol",
                                        "@Id_PC",
                                        "@Id_Cte" };
                object[] Valores = { sol.Id_Sol,
                                     sol.Id_PC,
                                     sol.Id_Cte };

                SqlCommand sqlcmd = cd_datos.GenerarSqlCommand("spProPrecioConv_DesvinculaUno", ref Verificador, Parametros, Valores);

                cd_datos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 9
0
        public void Convenio_ConsultaVinculados(int Id_PC, int Id_CD, ref List <SolConvenioDet> List, string Conexion)
        {
            try
            {
                CD_Datos      cd_datos = new CD_Datos(Conexion);
                SqlDataReader dr       = null;

                string[] Parametros = { "@Id_PC",
                                        "@Id_Cd" };
                object[] Valores = { Id_PC,
                                     Id_CD };

                SqlCommand sqlcmd = cd_datos.GenerarSqlCommand("spProPrecioConv_ConsultaClientes", ref dr, Parametros, Valores);

                SolConvenioDet s;

                while (dr.Read())
                {
                    s               = new SolConvenioDet();
                    s.Id_Sol        = Convert.ToInt32(dr["Id_Sol"]);
                    s.Id_PC         = Convert.ToInt32(dr["Id_PC"]);
                    s.Id_Cte        = Convert.ToInt32(dr["Id_Cte"]);
                    s.Sol_CteNombre = dr["Sol_CteNombre"].ToString();
                    s.Sol_UsuFinal  = dr["Sol_UsuFinal"].ToString();
                    s.CDI           = dr["CDI"].ToString();
                    s.Sol_UNombre   = dr["Sol_UNombre"].ToString();
                    s.SolTer_Nombre = dr["SolTer_Nombre"].ToString();
                    List.Add(s);
                }

                dr.Close();

                cd_datos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 10
0
        public void ConvenioDesvinculo_EnviarCorreo(SolConvenioDet sol, string Conexion)
        {
            try
            {
                CD_Datos   cd_datos    = new CD_Datos(Conexion);
                int        Verificador = 0;
                string[]   Parametros  = { "@Id_Sol",
                                           "@Id_PC",
                                           "@Id_Cte",
                                           "@U_Nombre" };
                object[]   Valores = { sol.Id_Sol,
                                       sol.Id_PC,
                                       sol.Id_Cte,
                                       sol.U_Nombre };
                SqlCommand sqlcmd = cd_datos.GenerarSqlCommand("spPrecioConvenio_CorreoCancelo", ref Verificador, Parametros, Valores);

                cd_datos.LimpiarSqlcommand(ref sqlcmd);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }