Пример #1
0
        protected void btnActualizar_Click(object sender, EventArgs e)
        {
            String url      = System.Configuration.ConfigurationManager.AppSettings["URL_WS_C9"].ToString();
            string strWS    = "";
            string IdSocio9 = "0";
            int    error309 = 0;
            int    result   = 0;

            try
            {
                if (hidEsEmpleado.Value == "0")
                {
                    ValidacionesContexto();
                    if (!Comun.CheckURLWs(url, 10000))
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('El Servicio de CLIENTE 9 no esta accesible.');", true);
                        return;
                    }
                    AsignaDatosNine();
                    objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();
                    result = objNine.ActualizaDatosCliente(client9, client9Extend, Session["IdEmpleado"].ToString(), Session["IdTienda"].ToString(), Session["IdTerminal"].ToString(), ref strWS, ref IdSocio9, ref error309);
                    if (error309 == 1)
                    {
                        hidMsjError.Value = strWS;
                        ClientScriptManager cs = Page.ClientScript;
                        cs.RegisterStartupScript(this.GetType(), "Numero de Tarjeta No Valido", "ConfirmarTJT('¿Desea actualizar tarjeta en TPV a pesar de mensaje devuelto por C9?');", true);
                    }
                    if (result > 0 && result != 309)
                    {
                        LimpiaControles();
                        reiniciaLstCIF();
                        LimpiaControlesFacturacion();
                        this.nomcliente.Text = "";
                        ListDatosFact        = null;
                        DatosFact            = null;
                        ValidaControles();
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('El cliente con IdSocio:" + IdSocio9 + " ha sido actualizado en el sistema');", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('Se produjo un error al actualizar el cliente, en el sistema:" + strWS + "');", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('Error, El Cliente es Empleado.');", true);
                }
            }
            catch (Exception ex) {
                log.Error("Exception Actualizar_click:" + ex.Message.ToString());
            }
        }
Пример #2
0
 protected void btnBuscaCliente_Click(object sender, EventArgs e)
 {
     try
     {
         LimpiaControles();
         this.ListDatosFact = null;
         this.DatosFact     = null;
         if (nomcliente.Text != "")
         {
             GetClienteActual(nomcliente.Text);
             if (hidIdCliente.Value != "")
             {
                 ListDatosFact = new List <FacturacionC9>();
                 getDatosFacturacion(hidIdCliente.Value);
             }
         }
     }
     catch (Exception ex)
     {
         log.Error(ex.Message.ToString());
     }
 }