Esempio n. 1
0
        public object Get(Time_Logs request)
        {
            ApiUser hdUser = request.ApiUser;

            int logID = 0;

            if (!int.TryParse(request.key, out logID))
            {
                throw new HttpError(HttpStatusCode.NotFound, "incorrect key");
            }

            if (!string.IsNullOrEmpty(request.type) && request.type.ToLower() == "project")
            {
                DataRow plRow = bigWebApps.bigWebDesk.Data.Project.SelectProjectTimeByID(hdUser.OrganizationId, hdUser.DepartmentId, logID);
                if (plRow == null)
                {
                    throw new HttpError(HttpStatusCode.NotFound, "key not found");
                }
                return(new ProjectTimeLog(plRow));
            }

            DataRow tlRow = bigWebApps.bigWebDesk.Data.Tickets.SelectTicketTimeByID(hdUser.OrganizationId, hdUser.DepartmentId, logID);

            if (tlRow == null)
            {
                throw new HttpError(HttpStatusCode.NotFound, "key not found");
            }
            return(new TimeLog(tlRow));
        }
Esempio n. 2
0
        public object Get(Time_Logs request)
        {
            ApiUser hdUser = request.ApiUser;

            int logID = 0;
            if (!int.TryParse(request.key, out logID))
            {
                throw new HttpError(HttpStatusCode.NotFound, "incorrect key");
            }

            if (!string.IsNullOrEmpty(request.type) && request.type.ToLower() == "project")
            {
                DataRow plRow = bigWebApps.bigWebDesk.Data.Project.SelectProjectTimeByID(hdUser.OrganizationId, hdUser.DepartmentId, logID);
                if (plRow == null)
                {
                    throw new HttpError(HttpStatusCode.NotFound, "key not found");
                }
                return new ProjectTimeLog(plRow);
            }

            DataRow tlRow = bigWebApps.bigWebDesk.Data.Tickets.SelectTicketTimeByID(hdUser.OrganizationId, hdUser.DepartmentId, logID);
            if (tlRow == null)
            {
                throw new HttpError(HttpStatusCode.NotFound, "key not found");
            }
            return new TimeLog(tlRow);
        }