public static Personal_foto PersonalFotoAdd(Personal_foto o, string path) { Personal_fotoMng oMng = new Personal_fotoMng() { O_Personal_foto = o }; IDbTransaction trans = null; try { //Comienza la transanccion trans = GenericDataAccess.BeginTransaction(); string provname = DateTime.Now.ToString("hhmmssffffff"); CommonCtrl.AddImgToDirectory(path, provname, o.Foto); o.Foto = provname; oMng.add(trans); GenericDataAccess.CommitTransaction(trans); } catch { if (trans != null) { GenericDataAccess.RollbackTransaction(trans); } throw; } return(o); }
private static void PersonalFotoDltByUser(int id_usuario) { try { Personal_fotoMng oMng = new Personal_fotoMng(); Personal_foto o = new Personal_foto() { Id_usuario = id_usuario }; oMng.O_Personal_foto = o; oMng.dltByUser(); } catch { throw; } }
public static Personal_foto PersonalFotoUdt(int id_usuario) { Personal_foto o = new Personal_foto() { Id_usuario = id_usuario }; try { Personal_fotoMng oMng = new Personal_fotoMng(); oMng.O_Personal_foto = o; oMng.selByIdUsuario(); } catch { throw; } return(o); }
public override void fillLst() { try { this.comm = GenericDataAccess.CreateCommandSP("sp_Personal_foto"); addParameters(0); this.dt = GenericDataAccess.ExecuteSelectCommand(comm); this._lst = new List <Personal_foto>(); foreach (DataRow dr in dt.Rows) { Personal_foto o = new Personal_foto(); BindByDataRow(dr, o); this._lst.Add(o); } } catch { throw; } }
protected void BindByDataRow(DataRow dr, Personal_foto o) { try { int.TryParse(dr["id"].ToString(), out entero); o.Id = entero; entero = 0; o.Foto = dr["foto"].ToString(); if (dr["id_usuario"] != DBNull.Value) { int.TryParse(dr["id_usuario"].ToString(), out entero); o.Id_usuario = entero; entero = 0; } } catch { throw; } }
public Personal_fotoMng() { this._oPersonal_foto = new Personal_foto(); this._lst = new List <Personal_foto>(); }