protected void txtUpdate_Click(object sender, EventArgs e)
        {
            ScheduleReference.ScheduleSoapClient client = new ScheduleReference.ScheduleSoapClient();
            int row = client.updateRecord(txtID.Text, ddlstatus.SelectedItem.ToString());

            if (row > 0)
            {
                Response.Write("<script>alert('Update successfuly');</script>");
            }
            else
            {
                Response.Write("<script>alert('Record not update');</script>");
            }
        }
        protected void txtDelete_Click(object sender, EventArgs e)
        {
            ScheduleReference.ScheduleSoapClient client = new ScheduleReference.ScheduleSoapClient();


            if (txtID.Text == "")
            {
                Response.Write("<script>alert('Delete failed, no id is inserted');</script>");
            }
            else
            {
                Response.Write("<script>alert('Delete sucess.');</script>");
                int row = client.deleteRecord(txtID.Text);
            }
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            ScheduleReference.ScheduleSoapClient client = new ScheduleReference.ScheduleSoapClient();



            if (txtTrackID.Text == "")
            {
                Response.Write("<script>alert('No ID is inserted , Please try again.');</script>");
                txtTrackID.Focus();
            }

            else
            {
                GridView1.DataSource = client.GetLatestCustomers(txtTrackID.Text);
                GridView1.DataBind();
            }
        }
Beispiel #4
0
        protected void txtSubmit_Click(object sender, EventArgs e)
        {
            string busstatus = "On Going";

            //allow user add the new schedule
            ScheduleReference.ScheduleSoapClient client = new ScheduleReference.ScheduleSoapClient();
            int row = client.InsertLatestSchedule(txtID.Text, ddlFrom.SelectedItem.ToString(), ddlDestination.SelectedItem.ToString(), txtDate.Text, ddlTime.SelectedItem.ToString(), ddlBusID.SelectedItem.ToString(), ddlDriverID.SelectedItem.ToString(), busstatus);

            if (row > 0)
            {
                Response.Write("<script>alert('Record insert successfuly');</script>");
                txtID.Text = ddlDestination.Text = txtDate.Text = ddlTime.Text = "";
            }
            else
            {
                Response.Write("<script>alert('Record not insert');</script>");
            }
        }