public static List <ATTGroup> GetGroupListWithMember(int?orgID, bool ContainDefault, char type) { try { List <ATTGroupMember> lstGM = BLLGroupMember.GetGroupMemberList(null); List <ATTGroup> lstGroup = new List <ATTGroup>(); foreach (DataRow row in DLLGroup.GetGroupListTable(orgID, type).Rows) { ATTGroup objGroup = new ATTGroup(int.Parse(row["ORG_ID"].ToString()), int.Parse(row["GROUP_ID"].ToString()), row["GROUP_NAME"].ToString(), row["DESCRIPTION"].ToString(), row["ACTIVE"].ToString() ); objGroup.LstGroupMember = lstGM.FindAll ( delegate(ATTGroupMember m) { return (m.OrgID == objGroup.OrgID && m.GroupID == objGroup.GroupID); } ); lstGroup.Add(objGroup); } if (ContainDefault == true && lstGroup.Count > 0) { lstGroup.Insert(0, new ATTGroup(0, 0, "छान्नुहोस्", "", "")); } return(lstGroup); } catch (Exception ex) { throw (ex); } }
public static List <ATTEvent> GetEventList(string dateString, ATTUserLogin login) { try { List <ATTEvent> lstEvents = new List <ATTEvent>(); DataTable tblME = new DataTable(); tblME = BLLMeeting.GetMeetingEventListTable(dateString, login); tblMA = new DataTable(); tblMA = BLLMeetingAgenda.GetMeetingAgendaListTable(dateString, login); tblMP = new DataTable(); tblMP = BLLMeetingParticipant.GetMeetingParticipantListTable(dateString, login); lstGroupMember = BLLGroupMember.GetGroupMemberList(null); ATTGroupMember objGM = lstGroupMember.Find(delegate(ATTGroupMember obj) { return(obj.OrgID == login.OrgID && obj.EmpID == login.PID); } ); foreach (DataRow row in tblME.Rows) { ATTEvent objEvent = new ATTEvent(); objEvent.Day = int.Parse(row["meeting_date"].ToString().Split('/')[2].ToString()); objEvent.OrgID = int.Parse(row["Org_ID"].ToString()); objEvent.EventID = int.Parse(row["MEETING_ID"].ToString()); //int stop; //stop = objEvent.EventID; /*if (objEvent.EventID == 21) * stop = 0; */ //CALLED_BY_P_ID int?calledByID; if (row["CALLED_BY_P_ID"].ToString() != "") { calledByID = int.Parse(row["CALLED_BY_P_ID"].ToString()); } else { calledByID = null; } if (calledByID == null) { int calleby = int.Parse(row["called_by"].ToString()); string userName = row["ENTRY_BY"].ToString().Trim(); string entryBy = row["m_entry_by"].ToString().Trim(); if (login.UserName.Trim() == row["ENTRY_BY"].ToString().Trim() || login.UserName.Trim() == row["m_entry_by"].ToString().Trim()) { if (row["meeting_subject"].ToString().Length > 15) { objEvent.Event = "<i><b>" + row["meeting_subject"].ToString().Substring(0, 15) + ".....</i></b>"; } else { objEvent.Event = "<i><b>" + row["meeting_subject"].ToString() + "</i></b>"; } objEvent.InOut = "IN"; } else if (objGM != null) { if (objGM.GroupID == int.Parse(row["called_by"].ToString())) { if (row["meeting_subject"].ToString().Length > 15) { objEvent.Event = "<i><b>" + row["meeting_subject"].ToString().Substring(0, 15) + ".....</i></b>"; } else { objEvent.Event = "<i><b>" + row["meeting_subject"].ToString() + "</i></b>"; } objEvent.InOut = "IN"; } else { if (row["meeting_subject"].ToString().Length > 15) { objEvent.Event = "<b>" + row["meeting_subject"].ToString().Substring(0, 15) + ".....</b>"; } else { objEvent.Event = "<b>" + row["meeting_subject"].ToString() + "</b>"; } objEvent.InOut = "OUT"; } } else { if (row["meeting_subject"].ToString().Length > 15) { objEvent.Event = "<b>" + row["meeting_subject"].ToString().Substring(0, 15) + ".....</b>"; } else { objEvent.Event = "<b>" + row["meeting_subject"].ToString() + "</b>"; } objEvent.InOut = "OUT"; } } else { if (calledByID == login.PID || login.UserName.Trim() == row["ENTRY_BY"].ToString().Trim() || login.UserName.Trim() == row["m_entry_by"].ToString().Trim()) { if (row["meeting_subject"].ToString().Length > 15) { objEvent.Event = "<i>" + row["meeting_subject"].ToString().Substring(0, 15) + ".....</i>"; } else { objEvent.Event = "<i>" + row["meeting_subject"].ToString() + "</i>"; } objEvent.InOut = "IN"; } else { if (row["meeting_subject"].ToString().Length > 15) { objEvent.Event = row["meeting_subject"].ToString().Substring(0, 15) + "....."; } else { objEvent.Event = row["meeting_subject"].ToString(); } objEvent.InOut = "OUT"; } } objEvent.EventDetail = "(" + row["start_time"].ToString() + " - " + row["end_time"].ToString() + ") \n " + row["meeting_subject"].ToString(); objEvent.StatusColor = row["MSTATUS_COLOR"].ToString(); objEvent.LstMeeting = SetMeeting(row, dateString, login); lstEvents.Add(objEvent); } return(lstEvents); } catch (Exception ex) { throw (ex); } }