public HttpResponseMessage AddUser(PM_ACT_GROUP_TERMINAL groupTerm) { groupTerm.CreatedOn = SSGlobalConfig.Now; PM_ACT_GROUP_TERMINAL newgroupTerm = groupTerminalBO.Insert(groupTerm); if (newgroupTerm != null) { return(Request.CreateResponse(HttpStatusCode.OK, "新增成功")); } else { return(Request.CreateResponse(HttpStatusCode.InternalServerError, "新增失败")); } }
public IList <PM_ACT_GROUP_TERMINAL> GetEntities(PM_ACT_GROUP_TERMINAL entity) { if (entity == null) { return(null); } else { IList <PM_ACT_GROUP_TERMINAL> list = new List <PM_ACT_GROUP_TERMINAL>(); try { list = groupTerminalBO.GetEntities(entity); return(list); } catch (Exception e) { throw e; } } }
public PM_ACT_GROUP_TERMINAL addGroupTerminal(List <PM_ACT_GROUP_TERMINAL> list) { if (list == null || list.Count == 0) { return(null); } else { IList <PM_ACT_GROUP_TERMINAL> Ilist = new List <PM_ACT_GROUP_TERMINAL>(); PM_ACT_GROUP_TERMINAL result = new PM_ACT_GROUP_TERMINAL(); try { for (int i = 0; i < list.Count; i++) { result = list[i]; Ilist = groupTerminalBO.GetEntities(result); if (Ilist.Count > 0) //已存在 { list[i].CreatedOn = SSGlobalConfig.Now; int num = (int)Ilist[i].GroupTermPK; list[i].GroupTermPK = num; groupTerminalBO.UpdateSome(list[i]); } else { list[i].CreatedOn = SSGlobalConfig.Now; result = groupTerminalBO.Insert(list[i]); } } return(result); } catch (Exception e) { throw e; } } }