private void GetClienteActual(string sCliente) { objNine = new DLLGestionCliente9.ClsCliente9(); objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString(); List <DLLGestionCliente9.Models.Cliente9> objclient = objNine.GetClienteAdm9(sCliente, Contexto.FechaSesion); if (objclient.Count > 0) { if (objclient.Count == 1) { txtNombre.Text = objclient[0].Nombre; txtApellidos.Text = objclient[0].Apellidos; txtEmail.Text = objclient[0].Email; txtFecNac.Text = Convert.ToDateTime(objclient[0].FechaNacimiento.ToString()).ToShortDateString(); txtTfnoCasa.Text = objclient[0].Telefono.ToString(); txtMovil.Text = objclient[0].Movil.ToString(); txtNivel.Text = objclient[0].NivelActual.ToString(); hidNivel.Value = txtNivel.Text; txtTarjetaActual.Text = objclient[0].NumTarjeta.ToString(); hidNumeroTarjetaCliente9.Value = objclient[0].NumTarjeta.ToString(); hidIdCliente.Value = objclient[0].Id_Cliente.ToString(); hidEsEmpleado.Value = objclient[0].esEmpleado.ToString(); if (txtNumTarjeta.Text == "") { txtNumTarjeta.Text = "22114005"; } ValidaControles(); } else { DLLGestionCliente9.Models.Cliente9 objclientAux; objclientAux = new DLLGestionCliente9.Models.Cliente9(); objclientAux.Id_Cliente = -1; objclientAux.Cliente = ""; objclient.Insert(0, objclientAux); LstClientes.DataTextField = "Cliente"; LstClientes.DataValueField = "ID_Cliente"; LstClientes.DataSource = objclient; LstClientes.DataBind(); hidIdCliente.Value = ""; hidEsEmpleado.Value = ""; nomcliente.CssClass = "ocul1"; LstClientes.CssClass = "visi1"; txtNombre.Text = ""; txtApellidos.Text = ""; txtEmail.Text = ""; txtFecNac.Text = ""; txtTfnoCasa.Text = ""; txtMovil.Text = ""; txtNumTarjeta.Text = ""; txtNivel.Text = ""; } } }
protected int ValidaTarjeta_PuntosNet(NuevoCambioC9 cambio9, int option) { int result = 0; string msjValidacion = ""; client9 = new DLLGestionCliente9.Models.Cliente9(); ws.cls_Cliente9.ConsultaBeneficios cb = new ws.cls_Cliente9.ConsultaBeneficios(); //se hace una consulta de beneficios para validar el nivel actual result = ConsultaBeneficios(cambio9, ref cb); if (result == 1) { //Validamos los datos recibidos en la consulta con el cambio que se quiere realizar if (cambio9.Referencia == "750000000161" && (cb.strNivelActual.ToUpper()) == "SHOE LOVERS") { msjValidacion = "No es posible vender tarjeta upgrade shoelover a un socio con nivel shoe lovers."; } else if (cambio9.Referencia == "750000000161" && !cb.blnShoeLover) { msjValidacion = "No es posible vender tarjeta upgrade shoelover a un socio que no es candidato a shoelover."; } else if (cambio9.Referencia == "750000000437" && (cb.strNivelActual.ToUpper()) == "FIRST SHOELOVERS") { msjValidacion = "No es posible vender tarjeta upgrade first shoelover a un socio con nivel first shoelovers."; } else if (cambio9.Referencia == "750000000437" && cb.strCandFirstC9.ToUpper() == "NO") { msjValidacion = "No es posible vender tarjeta upgrade first shoelover a un socio que no es candidato a first shoelover."; } else if (cambio9.Referencia == "750000000436" && (cb.strNivelActual.ToUpper()) == "BASICO") { msjValidacion = "No es posible vender tarjeta upgrade básica a un socio con nivel básico."; } else if (cambio9.Referencia == "750000000436" && cb.strCandBasicoC9.ToUpper() == "FALSE") { msjValidacion = "No es posible vender tarjeta upgrade básica a un socio que no es candidato a tarjeta básica."; } if (msjValidacion != "") { result = 0; ScriptManager.RegisterStartupScript(this, typeof(Page), "Validacion Cliente 9", "alert('" + msjValidacion + "');", true); } else { result = 1; } } return(result); }
public int ActualizaDatosCliente(Models.Cliente9 client, Models.Cliente9Extent clientExtend, string IdEmpleado, string IdTienda, string IdTerminal, ref string strWS, ref string IdSocioC9, ref int error309) { int result = 0; SqlTransaction sqlTrans; string cadConexion = ""; error309 = 0; strWS = ""; IdSocioC9 = ""; objCapaDatos = new ClsCapaDatos9(); objCapaDatos.ConexString = StrCadenaConexion; sqlTrans = objCapaDatos.GetTransaction(); cadConexion = sqlTrans.Connection.ConnectionString; try { result = objCapaDatos.TryAbreConexion(ref sqlTrans); result = objCapaDatos.ActualizacionCliente9(client, clientExtend, IdEmpleado, sqlTrans); if (result > 0) { result = ws_ActualizaSocio(client, clientExtend, IdEmpleado, IdTienda, IdTerminal, ref strWS, ref IdSocioC9, cadConexion); if (result == 309) { error309 = 1; sqlTrans.Commit(); } if (result > 0) { if (error309 != 1) { objCapaDatos.ActualizaIdC9(IdSocioC9, client, sqlTrans); sqlTrans.Commit(); } } else { sqlTrans.Rollback(); } } else { sqlTrans.Rollback(); } objCapaDatos.TryCierraConexion(); } catch (Exception ex) { log.Error("ClsCliente9.ActualizaCliente:" + ex.Message.ToString()); sqlTrans.Rollback(); } return(result); }