コード例 #1
0
        public static MemberAccountItem Get(entitiesEvolveCentral ctx, int itemid)
        {
            var item = new MemberAccountItem();

            try
            {
                item = (from i in ctx.MemberAccountItems where i.Id == itemid select i).FirstOrDefault();
            }
            catch (Exception ex)
            {
                ApplicationLog.Log(ctx, "DAL.MemberAccount.Get(entitiesEvolveCentral ctx, int itemid)", ex.Message);
                item = null;
            }

            return(item);
        }
コード例 #2
0
        public static bool Delete(entitiesEvolveCentral ctx, MemberAccountItem item)
        {
            bool retval = true;

            try
            {
                ctx.MemberAccountItems.Remove(item);
                ctx.SaveChanges();
            }
            catch (Exception ex)
            {
                ApplicationLog.Log(ctx, "DAL.MemberAccount.Delete(entitiesEvolveCentral ctx, MemberAccountItem item)", ex.Message);
                retval = false;
            }

            return(retval);
        }