public bool Add(clsMessage obj, int ID) { if (Exist(ID)) { return(false); } else { myList.Add(ID, obj); return(true); } }
public bool Update(clsMessage obj, int ID) { if (!Exist(ID)) { return(false); } else { if (Delete(ID)) { myList.Add(ID, obj); return(true); } else { return(false); } } }
public static clsListMessages getMessages(int employeeID) { clsListMessages tmp = new clsListMessages(); IRemaxData rmx = new clsRemaxData(); DataTable tab = null; tab = rmx.getMessages(employeeID); foreach (DataRow rowMessage in tab.Rows) { clsMessage msg = new clsMessage(Convert.ToInt32(rowMessage["ID"]), Convert.ToInt32(rowMessage["employee"]), rowMessage["message"].ToString(), Convert.ToByte(rowMessage["status"]), Convert.ToDateTime(rowMessage["messagedate"])); tmp.Add(msg, msg.ID); msg = null; } tab = null; return(tmp); }