public HttpResponseMessage GetProjectEventsByProjectId(int projectid = 0, int userid = 0) { try { PM_TodoBL pd = new PM_TodoBL(); PM_ProjectEventFilters_DTO rec = new PM_ProjectEventFilters_DTO(); string WhereClause = ""; if (projectid != 0 && userid != 0) { rec = pd.GetTodofilters("Get_Todo_Filters", projectid, userid, WhereClause); } if (rec != null) { return(Request.CreateResponse(HttpStatusCode.OK, rec)); } else { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Data")); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message)); } }
public PM_ProjectEventFilters_DTO GetTodofilters(string filter, Int64 projectId, Int64 UserId, string WhereClause = "") { DataSet ds = dal.GetDataset(filter, projectId, UserId); PM_ProjectEventFilters_DTO pl = new PM_ProjectEventFilters_DTO(); pl.Statuses = ds.Tables[0].ToList <DTO.Status>(); if (ds.Tables.Count > 1) { pl.Task = ds.Tables[1].ToList <PM_Task_DTO>(); } if (ds.Tables.Count > 2) { pl.Entities = ds.Tables[2].ToList <PM_Entity_DTO>(); } if (ds.Tables.Count > 3) { pl.UserProjects = ds.Tables[3].ToList <Security.Entities.Sec_UserProjects>(); } if (ds.Tables.Count > 4) { pl.Types = ds.Tables[4].ToList <PM_Type_DTO>(); } return(pl); }