Ejemplo n.º 1
0
        public static Boolean EditDoor(EditDoor composite)
        {
            using (SqlConnection connectionstring = new SqlConnection(cstring))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    connectionstring.Open();
                    cmd.CommandText = "UPDATE DoorTable SET DoorID = @p1 WHERE DoorID = @p2";
                    cmd.Parameters.AddWithValue("@p1", composite.NewDoornr);
                    cmd.Parameters.AddWithValue("@p2", composite.OldDoornr);
                    cmd.CommandType = CommandType.Text;
                    cmd.Connection  = connectionstring;

                    try
                    {
                        cmd.ExecuteNonQuery();
                        return(true);
                    }
                    catch
                    {
                        return(false);
                    }
                    finally
                    {
                        connectionstring.Close();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public bool UpdateDoor(EditDoor composite)
 {
     return(DataHelper.EditDoor(composite));
 }
Ejemplo n.º 3
0
 public void EditDoor(EditDoor composite)
 {
     DataHelper.EditDoor(composite);
 }