Example #1
0
        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);
        }