Exemplo n.º 1
0
 public void updateProject(Project anProject)
 {
     using (SqlCommand cmd = DatabaseContext.Connection.CreateCommand())
     {
         cmd.CommandText = "update project set ProjectName=" + "'" + anProject.ProjectName + "',isClosed='" + anProject.isClosed + "', CustomerNo='" + anProject.CustomerNo + "' where projectno=" + anProject.ProjectNo + ";";
         cmd.ExecuteNonQuery();
     }
 }
Exemplo n.º 2
0
        public Project getProjectByNo(int no)
        {
            Project result = null;

            using (SqlCommand cmd = new SqlCommand("select * from project where projectNo = " + no, DatabaseContext.Connection ))
            {
                SqlDataReader reader = cmd.ExecuteReader();

                while(reader.Read())
                {
                    result = new Project { ProjectName = reader["ProjectName"].ToString() };
                }

                reader.Close();
            }
            return result;
        }
Exemplo n.º 3
0
        private void updateProject()
        {
            Project anProject = new Project
            {

                ProjectNo = Int32.Parse(tbAdminProjectNo.Text.ToString()),
                ProjectName = tbAdminProjectName.Text.ToString(),
                isClosed = Convert.ToBoolean(cboxAdminProjectIsClosed.Checked),
                CustomerNo = Int32.Parse(Regex.Replace(cbAdminProjectCustomerNo.Text.ToString(), @"\D", string.Empty)),
            };

            context.ProjectService.updateProject(anProject);
        }
Exemplo n.º 4
0
 public void updateProject(Project anProject)
 {
     context.ProjectRepository.updateProject(anProject);
 }