Exemplo n.º 1
0
        public bool updateData(DTO.DTO_Office office)
        {
            try
            {
                SqlCommand command = getCommand("updateOffice");
                command.Parameters.Add("@officeID", System.Data.SqlDbType.VarChar).Value   = office.OfficeID;
                command.Parameters.Add("@officeName", System.Data.SqlDbType.VarChar).Value = office.OfficeName;

                return(command.ExecuteNonQuery() >= 0);
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool insertData(DTO.DTO_Office newOffice)
        {
            try
            {
                SqlConnection con     = DAL.DAL_DB_Connect.connection;
                SqlCommand    command = new SqlCommand("insertOffice", con);

                command.Parameters.Add("@officeID", System.Data.SqlDbType.VarChar).Value   = newOffice.OfficeID;
                command.Parameters.Add("@officeName", System.Data.SqlDbType.VarChar).Value = newOffice.OfficeName;
                command.CommandType = System.Data.CommandType.StoredProcedure;

                return(command.ExecuteNonQuery() >= 0);
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 3
0
 public bool updateData(DTO.DTO_Office office)
 {
     return(new DAL.DAL_Office().updateData(office));
 }
Exemplo n.º 4
0
 public bool insertData(DTO.DTO_Office office)
 {
     return(new DAL.DAL_Office().insertData(office));
 }