Example #1
0
        public int AttributeNameDelete(AttributeNameModel at)
        {
            AttributeName a = new AttributeName()
            {
                ANID = at.ANID, ANName = at.ANName, ATID = at.ATID
            };

            return(Delete(a));
        }
Example #2
0
        public ActionResult Del(int id)
        {
            AttributeNameModel an = new AttributeNameModel()
            {
                ANID = id
            };

            if (iat.AttributeNameDelete(an) > 0)
            {
                return(Content(""));
            }
            return(View());
        }
Example #3
0
        public ActionResult Add(int ATID, string ANName)
        {
            AttributeNameModel an = new AttributeNameModel()
            {
                ANName = ANName, ATID = ATID
            };

            if (iat.AttributeNameAdd(an) > 0)
            {
                return(Content("<script>alert('添加成功');window.location.href='Index'</script>"));
            }
            //return Content("<script>alert("+ATID.ToString()+" "+ANName+");window.location.href='Index'</script>");
            return(View());
        }
Example #4
0
        public List <AttributeNameModel> ProfessionSelect()
        {
            MyDbContext               db    = new MyDbContext();
            List <AttributeName>      list  = db.AttributeName.AsNoTracking().Where(e => e.ATID == 14).Select(e => e).ToList();
            List <AttributeNameModel> list2 = new List <AttributeNameModel>();

            foreach (AttributeName item in list)
            {
                AttributeNameModel am = new AttributeNameModel()
                {
                    ATID = item.ATID, ANName = item.ANName, ANID = item.ANID
                };
                list2.Add(am);
            }
            return(list2);
        }
Example #5
0
        List <AttributeNameModel> IAttributeTypeDAO.AttributeNameSelect()
        {
            MyDbContext db = new MyDbContext();
            //db.AttributeName.AsNoTracking().Join(db.AttributeType, s => s.ATID, cc => cc.ATID, (s, cc) => new { s.ANID, s.ANName, cc.ATName }).ToList()
            var res = db.AttributeName.AsNoTracking().Join(db.AttributeType, s => s.ATID, cc => cc.ATID, (s, cc) => new { s.ANID, s.ANName, cc.ATName });
            List <AttributeNameModel> list2 = new List <AttributeNameModel>();

            foreach (var item in res)
            {
                AttributeNameModel sm = new AttributeNameModel()
                {
                    ANID = item.ANID, ANName = item.ANName, ATName = item.ATName
                };
                list2.Add(sm);
            }
            return(list2);
        }
Example #6
0
 public int AttributeNameUpdate(AttributeNameModel at)
 {
     throw new NotImplementedException();
 }
Example #7
0
 public int AttributeNameDelete(AttributeNameModel at)
 {
     return(iat.AttributeNameDelete(at));
 }
Example #8
0
 public int AttributeNameAdd(AttributeNameModel at)
 {
     return(iat.AttributeNameAdd(at));//2
 }