View Reservation
sing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using System.Collections;
using System.Data;
namespace SkyShuttleRide.Admin
{
public partial class EditReservation : System.Web.UI.Page
{
DALSky objDalSky;
protected void Page_Load(object sender, EventArgs e)
{
objDalSky = new DALSky();
SetReservation();
}
private void SetReservation()
{
if (Session["resid"]!=null)
{
DataSet dtst = objDalSky.GetReservationById(Convert.ToInt32(Session["resid"]));
if (dtst.Tables[0].Rows.Count > 0)
{
DataRow dtrw = dtst.Tables[0].Rows[0];
rdobtnlstTrp.Items.FindByValue(dtrw[1].ToString()).Selected = true;
rdobtnlstRdTp.Items.FindByValue(dtrw[3].ToString()).Selected = true;
txtNoAdlt.Text = dtrw[4].ToString();
txtNoChldrn.Text = dtrw[5].ToString();
txtPickupDate.Text = dtrw[6].ToString();
txtFrstNm.Text = dtrw[7].ToString();
txtLastNm.Text = dtrw[8].ToString();
txtTlPhn.Text = dtrw[9].ToString();
txtEmail.Text = dtrw[10].ToString();
txtFltNm.Text = dtrw[11].ToString();
txtFltTime.Text = dtrw[12].ToString();
txtAddress.Text = dtrw[13].ToString();
txtNoMiles.Text = dtrw[14].ToString();
txtCost.Text = dtrw[15].ToString();
}
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
if (Session["resid"] != null)
{
ArrayList parameters = new ArrayList();
parameters.Add(Convert.ToInt32(Session["resid"]));
parameters.Add(rdobtnlstTrp.SelectedValue.ToString());
if (CheckBox1.Checked == true)
{
parameters.Add("YES");
}
else
{
parameters.Add("NO");
}
parameters.Add(rdobtnlstRdTp.SelectedValue.ToString());
parameters.Add(Convert.ToInt32(txtNoAdlt.Text));
parameters.Add(Convert.ToInt32(txtNoChldrn.Text));
parameters.Add(txtPickupDate.Text);
parameters.Add(txtFrstNm.Text);
parameters.Add(txtLastNm.Text);
parameters.Add(txtTlPhn.Text);
parameters.Add(txtEmail.Text);
parameters.Add(txtFltNm.Text);
parameters.Add(txtFltTime.Text);
parameters.Add(txtAddress.Text);
//parameters.Add(Convert.ToInt32(txtNoMiles.Text));
//parameters.Add(Convert.ToDecimal(txtCost.Text));
// int result = objDalSky.UpdateReservation(parameters);
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using System.Collections;
using System.Data;
namespace SkyShuttleRide.Admin
{
public partial class EditReservation : System.Web.UI.Page
{
DALSky objDalSky;
protected void Page_Load(object sender, EventArgs e)
{
objDalSky = new DALSky();
SetReservation();
}
private void SetReservation()
{
if (Session["resid"]!=null)
{
DataSet dtst = objDalSky.GetReservationById(Convert.ToInt32(Session["resid"]));
if (dtst.Tables[0].Rows.Count > 0)
{
DataRow dtrw = dtst.Tables[0].Rows[0];
rdobtnlstTrp.Items.FindByValue(dtrw[1].ToString()).Selected = true;
rdobtnlstRdTp.Items.FindByValue(dtrw[3].ToString()).Selected = true;
txtNoAdlt.Text = dtrw[4].ToString();
txtNoChldrn.Text = dtrw[5].ToString();
txtPickupDate.Text = dtrw[6].ToString();
txtFrstNm.Text = dtrw[7].ToString();
txtLastNm.Text = dtrw[8].ToString();
txtTlPhn.Text = dtrw[9].ToString();
txtEmail.Text = dtrw[10].ToString();
txtFltNm.Text = dtrw[11].ToString();
txtFltTime.Text = dtrw[12].ToString();
txtAddress.Text = dtrw[13].ToString();
txtNoMiles.Text = dtrw[14].ToString();
txtCost.Text = dtrw[15].ToString();
}
}
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
if (Session["resid"] != null)
{
ArrayList parameters = new ArrayList();
parameters.Add(Convert.ToInt32(Session["resid"]));
parameters.Add(rdobtnlstTrp.SelectedValue.ToString());
if (CheckBox1.Checked == true)
{
parameters.Add("YES");
}
else
{
parameters.Add("NO");
}
parameters.Add(rdobtnlstRdTp.SelectedValue.ToString());
parameters.Add(Convert.ToInt32(txtNoAdlt.Text));
parameters.Add(Convert.ToInt32(txtNoChldrn.Text));
parameters.Add(txtPickupDate.Text);
parameters.Add(txtFrstNm.Text);
parameters.Add(txtLastNm.Text);
parameters.Add(txtTlPhn.Text);
parameters.Add(txtEmail.Text);
parameters.Add(txtFltNm.Text);
parameters.Add(txtFltTime.Text);
parameters.Add(txtAddress.Text);
//parameters.Add(Convert.ToInt32(txtNoMiles.Text));
//parameters.Add(Convert.ToDecimal(txtCost.Text));
// int result = objDalSky.UpdateReservation(parameters);
}
}
}
}
0 comments:
Post a Comment