public void DeleteDepartment(string ticket, int departmentId, ref string message) { try { message = ""; if (!IsTicketValid(ticket)) { throw new Exception("票证验证失败!"); } YnDepartmentService.GetInstance().Delete(departmentId); } catch (Exception ex) { message = ex.Message; } }
public string GetDepartmentList(string ticket, int parentId, ref string message) { try { message = ""; if (!IsTicketValid(ticket)) { throw new Exception("票证验证失败!"); } List <YnDepartment> listYnDepartment = YnDepartmentService.GetInstance().GetList("", parentId, "", ""); return(YnBaseClass2.Helper.ObjectHelper.Serialize(listYnDepartment)); } catch (Exception ex) { message = ex.Message; } return(null); }
public bool UpdateDepartment(string ticket, string _ynDepartment, ref string message) { try { message = ""; if (!IsTicketValid(ticket)) { throw new Exception("票证验证失败!"); } YnDepartment ynDepartment = (YnDepartment)YnBaseClass2.Helper.ObjectHelper.Deserialize(typeof(YnDepartment), _ynDepartment); //ynUser.lastLoginDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); YnDepartmentService.GetInstance().Update(ynDepartment); return(true); } catch (Exception ex) { message = ex.Message; } return(false); }