public int UpdSoSocip(TOSoSocio toSoSocio) { List <Parameter> listAux = new List <Parameter>(); try { StringBuilder sql = new StringBuilder(); sql.Append(" UPDATE SO_SBENE "); sql.Append(" SET SBE_PASS = @P_SBE_PASS "); sql.Append(" WHERE EMP_CODI = @P_EMP_CODI "); sql.Append(" AND SOC_CONT = @P_SOC_CONT "); sql.Append(" AND SBE_CONT = @P_SBE_CONT "); listAux.Add(new Parameter("@P_SBE_PASS", toSoSocio.Soc_pass)); listAux.Add(new Parameter("@P_EMP_CODI", toSoSocio.Emp_codi)); listAux.Add(new Parameter("@P_SOC_CONT", toSoSocio.Soc_cont)); listAux.Add(new Parameter("@P_SBE_CONT", toSoSocio.Sbe_cont)); Parameter[] oParameter = listAux.ToArray(); OTOContext pTOContext = new OTOContext(); var conection = DBFactory.GetDB(pTOContext); var objeto = conection.Update(pTOContext, sql.ToString(), oParameter); return(objeto.AsInt()); } catch (Exception ex) { BOException.Throw(this.GetType().ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, ex); return(-1); } }
public TOSoSocio GetSoSocio(string sbe_ncar, int sbe_cont, short emp_codi) { TOSoSocio to = new TOSoSocio(); var socios = daoSoSocio.GetSoSbene(emp_codi, sbe_ncar); if (sbe_cont == 1 && socios.Count > 1) { var socio = socios.First(x => x.Sbe_cont == 1); to = socio; //to.Soc_nomb = socio.Soc_nomb; //to.Soc_apel = socio.Soc_apel; //to.Soc_tele = socio.Soc_tele; //to.Sbe_fexp = socio.Sbe_fexp; //to.Mac_nume = socio.Mac_nume; //to.Soc_foto = socio.Soc_foto; //to.Sbe_ncel = socio.Sbe_ncel; //to.Sbe_dire = socio.Sbe_dire; //to.Sbe_mail = socio.Sbe_mail; to.beneficiarios.AddRange(socios.Where(x => x.Sbe_cont != 1)); } else { var socio = socios.First(x => x.Sbe_cont == sbe_cont); to = socio; //to.Soc_nomb = socio.Soc_nomb; //to.Soc_apel = socio.Soc_apel; //to.Soc_tele = socio.Soc_tele; //to.Sbe_fexp = socio.Sbe_fexp; //to.Mac_nume = socio.Mac_nume; //to.Soc_foto = socio.Soc_foto; //to.Sbe_ncel = socio.Sbe_ncel; //to.Sbe_dire = socio.Sbe_dire; //to.Sbe_mail = socio.Sbe_mail; } to.Soc_pass = ""; return(to); }
public int UpdSoSocip(TOSoSocio toSoSocio) { int retorno = 0; toSoSocio.Soc_pass = Ophelia.Seven.Encrypta.EncriptarClave(toSoSocio.Soc_pass); if (toSoSocio.Soc_cont == 0) { retorno = 1; } var updpass = daoSoSocio.UpdSoSocip(toSoSocio); if (updpass > 0) { retorno = 0; } return(retorno); }
public TOTransaction <TOSoSocio> Post(TOSoSocio toSoSocio) // public int Post(TOSoSocio toSoSocio) { try { var KeyDecript = Ophelia.Seven.Encrypta.EncriptarClave(toSoSocio.Soc_pass); var socio = boSoSocio.GetSoSocio(toSoSocio.Sbe_ncar, KeyDecript, toSoSocio.Emp_codi); if (socio == null) { throw new Exception("Número de acción o contraseña incorrectos. Verifique por favor."); } socio = boSoSocio.GetSoSocio(toSoSocio.Sbe_ncar, socio.Sbe_cont, toSoSocio.Emp_codi); return(new TOTransaction <TOSoSocio>() { ObjTransaction = socio, Retorno = 0, TxtError = "" }); } catch (Exception ex) { return(new TOTransaction <TOSoSocio>() { ObjTransaction = null, Retorno = 1, TxtError = ex.Message }); } }
public void Put(int id, TOSoSocio value) { }
public int PostUpdate(TOSoSocio toSoSocio) { var socio = boSoSocio.UpdSoSocio(toSoSocio); return(socio); }
public int UpdSoSocio(TOSoSocio toSoSocio) { var updsocio = daoSoSocio.UpdSoSocio(toSoSocio); return(updsocio); }
public int Post(TOSoSocio toSoSocio) { var socio = boSoSocio.UpdSoSocip(toSoSocio); return(0); }