Exemplo n.º 1
0
        //Overload Constructor
        public Form1(Int32 intAppointment_ID)
        {
            InitializeComponent();
            PayneTools.FillClientDDL(cmbClient);

            //disable buttons when there is no need for them
            btnSubmit.Visible = false;
            btnSubmit.Enabled = false;

            //get data for one person and fill the fields
            Appointment   temp = new Appointment();
            SqlDataReader dr   = temp.FindOneAppointment(intAppointment_ID);

            //fill FindAppointment into form
            while (dr.Read())
            {
                dtpStartDT.Value       = Convert.ToDateTime(dr["STD"]);
                dtpEndingDT.Value      = Convert.ToDateTime(dr["ETD"]);
                cmbClient.SelectedItem = dr["Client"].ToString();
                txtLocation.Text       = dr["Location"].ToString();
                txtComments.Text       = dr["Comments"].ToString();

                //added this label to be able to use the variable
                labLocation_ID.Text = dr["ID"].ToString();
            }
        }
Exemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();
            PayneTools.FillClientDDL(cmbClient);

            //format for date and time
            dtpStartDT.CustomFormat  = "MM-d-yyyy  HH:mm";
            dtpEndingDT.CustomFormat = "MM-d-yyyy  HH:mm";
        }