public static bool UpdateProject(Project project)
        {
            string query = $"UPDATE managetasks.project SET numHour='{project.numHourForProject}',name='{project.ProjectName}',dateBegin={project.DateBegin} ,dateEnd={project.DateEnd} ,isFinish='{project.IsFinish}',customerName='{project.CustomerName}'  WHERE id={project.ProjectId} ";

            return(DBAccess.RunNonQuery(query) == 1);
        }
Ejemplo n.º 2
0
        public static string getPassword(int workerId)
        {
            string query = $"select password from workers where worker_id={workerId}";

            return(DBAccess.RunScalar(query).ToString());
        }
        /// <summary>
        /// Update worker in project
        /// </summary>
        /// <param name="projectWorker">projectWorker contain -idUser, idProject, HoursForProject </param>
        /// <returns>bool true-succsess update, false-failed update</returns>
        public static bool UpdateProjectWorker(ProjectWorker projectWorker)
        {
            string query = $"UPDATE managertasks.projectworker SET `hoursForProject` = {projectWorker.HoursForProject}  WHERE id={projectWorker.UserId} and projectId ={projectWorker.ProjectId}  ";

            return(DBAccess.RunNonQuery(query) == 1);
        }
Ejemplo n.º 4
0
        public static bool UpdateWorkerHours(int projectWorkerId, int numHours)
        {
            string query = $"UPDATE task_managment.project_workers SET allocated_hours={numHours} WHERE project_worker_id={projectWorkerId}";

            return(DBAccess.RunNonQuery(query) == 1);
        }