示例#1
0
        public void deleteMem(Guid pid)
        {
            var     mems = _ecdal.GetEntities(m => m.PID == pid);
            XiaoYan xy   = null;

            foreach (var mem in mems)
            {
                xy = mem;
            }
            var    pers = _persondal.GetEntities(m => m.PID == pid);
            Person ps   = null;

            foreach (var per in pers)
            {
                ps = per;
            }
            var     accs = _account.GetEntities(m => m.Username == ps.Username);
            Account at   = null;

            foreach (var acc in accs)
            {
                at = acc;
            }
            if (xy != null)
            {
                _memdal.Delete(xy);
                _persondal.Delete(ps);
                _account.Delete(at);
            }
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="id"></param>
 /// <param name="objContex"></param>
 public static void Delete(int id, PeopleContainer objContex)
 {
     try
     {
         PersonDal.Delete(id, objContex);
     }
     catch (Exception)
     {
     }
 }
示例#3
0
 /// <summary>
 /// Deleted a person
 /// </summary>
 /// <param name="id">Id person to deleted</param>
 /// <param name="objContex">Get table to object</param>
 public static void Delete(long id, ModelUnibookContainer objContex)
 {
     try
     {
         PersonDal.Delete(id, objContex);
     }
     catch (DbEntityValidationException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }