/// <summary> /// 根据地址号来删除地址 /// </summary> /// <param name="no">地址号</param> /// <returns>成功返回true</returns>未测试 public bool DeleteAddress(int no) { #region try { using (var dbcontext = new asimsContext()) { dbcontext.Remove <Address>(this.GetOneAddress(no)); return(true); } } catch { return(false); } #endregion }
/// <summary> /// 用户退单 /// </summary> /// <param name="id">用户id</param> /// <param name="mno">单号</param> /// <returns></returns>未测试 public bool UserChargeBack(string id, int mno) { #region try { using (var dbcontext = new asimsContext()) { var query = dbcontext.Market .FirstOrDefault(m => m.Sphone == id && m.Mno == mno); dbcontext.Remove(query); dbcontext.SaveChanges(); return(true); } } catch { return(false); } #endregion }