protected void bt_GoBack_Click(object sender, EventArgs e) { if ((int)ViewState["ID"] != 0) { Car_DispatchRide m = new Car_DispatchRide(); pl_detail.GetData(m); if (m.KilometresEnd == 0) { MessageBox.Show(this, "请输入还车时公里数!"); return; } if (m.KilometresEnd < m.KilometresStart) { MessageBox.Show(this, "还车时公里数不能小于发车时公里数!"); return; } Car_DispatchRideBLL _bll = new Car_DispatchRideBLL((int)ViewState["ID"]); _bll.GoBack(m.KilometresEnd, (int)Session["UserID"], m.RoadToll, m.FuelFee, m.ParkingFee, m.OtherFee); MessageBox.ShowAndRedirect(this, "确认还车成功!", "Car_DispatchRideList.aspx?State=3"); } }
protected void bt_GoBack_Click(object sender, EventArgs e) { if ((int)ViewState["ID"] != 0) { Car_DispatchRide m = new Car_DispatchRide(); pl_detail.GetData(m); if (m.KilometresEnd == 0) { MessageBox.Show(this, "请输入还车时公里数!"); return; } if (m.KilometresEnd < m.KilometresStart) { MessageBox.Show(this, "还车时公里数不能小于发车时公里数!"); return; } Car_DispatchRideBLL _bll = new Car_DispatchRideBLL((int)ViewState["ID"]); _bll.GoBack(m.KilometresEnd, (int)Session["UserID"], m.RoadToll, m.FuelFee, m.ParkingFee, m.OtherFee); MessageBox.ShowAndRedirect(this, "确认还车成功!", "Car_DispatchRideList.aspx?State=3"); } }
protected void bt_GoOut_Click(object sender, EventArgs e) { if ((int)ViewState["ID"] != 0) { Car_DispatchRide m = new Car_DispatchRide(); pl_detail.GetData(m); if (m.CarID == 0) { MessageBox.Show(this, "请选择车辆!"); return; } if (m.DriverStaff == 0) { MessageBox.Show(this, "请选择驾驶员!"); return; } Car_DispatchRideBLL _bll = new Car_DispatchRideBLL((int)ViewState["ID"]); _bll.GoOut(m.CarID, m.DriverStaff, m.KilometresStart, (int)Session["UserID"]); MessageBox.ShowAndRedirect(this, "确认出车成功!", "Car_DispatchRideList.aspx?State=2"); } }
protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e) { if (MCSTabControl1.SelectedIndex == 1 && e.Row.RowType == DataControlRowType.DataRow) { HyperLink hy_DispatchRide = (HyperLink)e.Row.FindControl("hy_DispatchRide"); if (hy_DispatchRide != null) { int carid = (int)gv_List.DataKeys[e.Row.RowIndex][0]; IList <Car_DispatchRide> lists = Car_DispatchRideBLL.GetModelList("Car_DispatchRide.State = 2 AND Car_DispatchRide.CarID=" + carid.ToString()); if (lists.Count > 0) { Car_DispatchRide m = lists[lists.Count - 1]; hy_DispatchRide.Text = m.Destination; hy_DispatchRide.NavigateUrl = "Car_DispatchRideDetail.aspx?ID=" + m.ID.ToString(); } } } }
protected void bt_GoOut_Click(object sender, EventArgs e) { if ((int)ViewState["ID"] != 0) { Car_DispatchRide m = new Car_DispatchRide(); pl_detail.GetData(m); if (m.CarID == 0) { MessageBox.Show(this, "请选择车辆!"); return; } if (m.DriverStaff == 0) { MessageBox.Show(this, "请选择驾驶员!"); return; } Car_DispatchRideBLL _bll = new Car_DispatchRideBLL((int)ViewState["ID"]); _bll.GoOut(m.CarID, m.DriverStaff, m.KilometresStart, (int)Session["UserID"]); MessageBox.ShowAndRedirect(this, "确认出车成功!", "Car_DispatchRideList.aspx?State=2"); } }