public int AttributeNameDelete(AttributeNameModel at) { AttributeName a = new AttributeName() { ANID = at.ANID, ANName = at.ANName, ATID = at.ATID }; return(Delete(a)); }
public ActionResult Del(int id) { AttributeNameModel an = new AttributeNameModel() { ANID = id }; if (iat.AttributeNameDelete(an) > 0) { return(Content("")); } return(View()); }
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()); }
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); }
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); }
public int AttributeNameUpdate(AttributeNameModel at) { throw new NotImplementedException(); }
public int AttributeNameDelete(AttributeNameModel at) { return(iat.AttributeNameDelete(at)); }
public int AttributeNameAdd(AttributeNameModel at) { return(iat.AttributeNameAdd(at));//2 }