public string editPosition(PM_EM_POSITION entity) { try { if (entity.PositionGuid == null) { return("岗位为空"); } //岗位编码不能重复 entity.RowDeleted = false; IList <PM_EM_POSITION> PositionIDList = positionBO.getPositionID(entity.PositionID, entity.RowDeleted); if (PositionIDList.Count > 0) { return("岗位编码已存在"); } //班组内岗位名不能重复 //IList<PM_EM_POSITION> PositionNameList = positionBO.getPositionName(entity.PositionName, entity.TeamGuid); //if (PositionNameList.Count > 0) //{ // return "班组已存在岗位名[" + entity.PositionName + "]"; //} positionBO.UpdateSome(entity); return("编辑成功"); } catch (Exception ex) { return("编辑失败:" + ex.Message); } }
public string AddPosition(PM_EM_POSITION entity) { try { //岗位编码不能重复 entity.RowDeleted = false; IList <PM_EM_POSITION> PositionIDList = positionBO.getPositionID(entity.PositionID, entity.RowDeleted); if (PositionIDList.Count > 0) { return("岗位编码已存在"); } //一个班组内岗位名称不能重复 IList <PM_EM_POSITION> PositionNameList = positionBO.getPositionName(entity.PositionName, entity.TeamGuid); if (PositionNameList.Count > 0) { return("本班组内已存在岗位名称[" + entity.PositionName + "]"); } entity.PositionGuid = Guid.NewGuid(); entity.CreatedOn = SSGlobalConfig.Now; entity.RowDeleted = false; PM_EM_POSITION list = positionBO.Insert(entity); if (list != null) { return("添加成功"); } return(null); } catch (Exception ex) { return("添加失败:" + ex.Message); } }
public string removePosition(PM_EM_POSITION entity) { try { if (entity.PositionGuid == null) { return("岗位为空"); } entity.RowDeleted = true; positionBO.UpdateSome(entity); return("删除成功"); } catch (Exception ex) { return("删除失败:" + ex.Message); } }