Beispiel #1
0
        /// <summary>
        /// Date Modified:   16/Oct/2013
        /// Modified By:     Josephine Gad
        /// (description)    Save the Vehicle Manifest if visible or hidden to vendor
        /// </summary>
        private void SaveVehicleManifest()
        {
            string    strLogDescription = "Show or Hide Vehicle Manifest to Vendor";
            DataTable dt = null;

            try
            {
                dt = new DataTable();
                DateTime   currentDate = CommonFunctions.GetCurrentDateTime();
                int        iCount      = uoListViewCrewAdmin.Items.Count;
                DataColumn col         = new DataColumn("TransactionID", typeof(Int64));
                dt.Columns.Add(col);
                col = new DataColumn("IsVisible", typeof(Boolean));
                dt.Columns.Add(col);
                DataRow     row;
                HiddenField listUOHiddenFieldTransID;
                CheckBox    listuoCheckBoxShow;

                for (int i = 0; i < iCount; i++)
                {
                    listuoCheckBoxShow = (CheckBox)uoListViewCrewAdmin.Items[i].FindControl("uoCheckBoxNoVehicleNeed");

                    if (listuoCheckBoxShow != null)
                    {
                        listUOHiddenFieldTransID = (HiddenField)uoListViewCrewAdmin.Items[i].FindControl("uoHiddenFieldTransID");
                        row = dt.NewRow();
                        row["TransactionID"] = listUOHiddenFieldTransID.Value;
                        if (listuoCheckBoxShow.Visible == true)
                        {
                            row["IsVisible"] = GlobalCode.Field2Bool(listuoCheckBoxShow.Checked);
                        }
                        else
                        {
                            row["IsVisible"] = false;
                        }
                        dt.Rows.Add(row);
                    }
                }
                VehicleManifestBLL BLL = new VehicleManifestBLL();
                BLL.UpdateVehicleManifestShowHide(uoHiddenFieldUser.Value, strLogDescription, "SaveVehicleManifest",
                                                  Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate).ToString(), dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sUserName = "";

            if (GlobalCode.Field2String(Session["UserName"]) == "")
            {
                sUserName           = MUser.GetUserName();
                Session["UserName"] = sUserName;
            }

            MembershipUser muser = Membership.GetUser(GlobalCode.Field2String(Session["UserName"]));

            if (muser == null)
            {
                Response.Redirect("~/Login.aspx", false);
            }
            else
            {
                if (muser.IsOnline == false)
                {
                    Response.Redirect("~/Login.aspx", false);
                }
            }



            DateTime date = GlobalCode.Field2DateTime(Request.QueryString["dDate"]);
            int      vID  = GlobalCode.Field2Int(Request.QueryString["VID"]);


            uoHiddenFieldDate.Value     = GlobalCode.Field2String(date);
            uoHiddenFieldVendorID.Value = GlobalCode.Field2String(vID);
            uoHiddenFieldVendor.Value   = GlobalCode.Field2String(Request.QueryString["sVN"]);

            VehicleManifestBLL         cs   = new VehicleManifestBLL();
            List <VehicleManifestList> List = new List <VehicleManifestList>();

            List = cs.GetPotentialSIGNOFF(0, vID, date);

            Session["PotenstialOFF"] = List;


            uoListViewManifestDetails.DataSource = null;
            uoListViewManifestDetails.DataBind();

            uoListViewManifestDetails.DataSource = List;
            uoListViewManifestDetails.DataBind();

            Session["strPrevPage"] = Request.RawUrl;
        }
        public void AirDetail()
        {
            try
            {
                VehicleManifestBLL bll = new VehicleManifestBLL();

                List <FlightHotelDetailPDF> list = new List <FlightHotelDetailPDF>();

                //list = bll.GetFlightHotelDetailPDF(0, GlobalCode.Field2Long(uoHiddenFieldSeafaredID.Value));

                //List<AirDetailPDF> lstAir = new List<AirDetailPDF>();
                //lstAir = list[0].AirDetailPDF;

                //lstviewAirDetail.DataSource = null;

                //lstviewAirDetail.DataSource = lstAir;
                //lstviewAirDetail.DataBind();

                //List<HotelDetailPDF> lstHotel = new List<HotelDetailPDF>();
                //lstHotel = list[0].HotelDetailPDF;

                //if (lstHotel.Count > 0)
                //{

                //    HotelDetailPDF n = lstHotel[0];

                //    lblCheckInDate.Text = GlobalCode.Field2String(n.CheckInDate);
                //    lblHotel.Text  = GlobalCode.Field2String(n.Chain);
                //    lblHotelAddress.Text = GlobalCode.Field2String(n.Location);
                //    lblNoOfDay.Text = GlobalCode.Field2String(n.NoOfDays);
                //    lblRoomType.Text = GlobalCode.Field2String(n.RoomType);
                //    lblContactPerson.Text = GlobalCode.Field2String(n.ContactPerson);
                //    lblContactNumber.Text = GlobalCode.Field2String(n.ContactNumber);
                //    lblEmail.Text = GlobalCode.Field2String(n.Email);

                //}
            }
            catch (Exception ex)
            {
                AlertMessage(ex.Message);
            }
        }
Beispiel #4
0
        private void InsertDriverTransaction()
        {
            try
            {
                VehicleManifestBLL BLL = new VehicleManifestBLL();
                DriverTransaction  d   = new DriverTransaction();

                DataTable dtparam = DriverTransaction();
                DataTable gtparam = GreeterTransaction();

                DataRow dr;

                HiddenField ConfirmedManifestID;
                HiddenField DriverRequestID;
                HiddenField uodfDriverPickupLatitude;
                HiddenField uodfDriverPickupLongitude;
                HiddenField uodfDriverDropOffLatitude;
                HiddenField uodfDriverDropOffLongitude;
                HiddenField uodfDriverParkingLatitude;
                HiddenField uodfDriverParkingLongitude;


                Label   Pickupdate;
                TextBox PickupTime;
                TextBox PickupLocation;
                TextBox DropOffLocation;


                foreach (ListViewDataItem list in uoListViewManifestConfirm.Items)
                {
                    ConfirmedManifestID = (HiddenField)list.FindControl("uoHiddenFieldConfirmedManifestID");
                    DriverRequestID     = (HiddenField)list.FindControl("uoHiddenFieldDriverRequestID");

                    uodfDriverPickupLatitude   = (HiddenField)list.FindControl("uodfDriverPickupLatitude");
                    uodfDriverPickupLongitude  = (HiddenField)list.FindControl("uodfDriverPickupLongitude");
                    uodfDriverDropOffLatitude  = (HiddenField)list.FindControl("uodfDriverDropOffLatitude");
                    uodfDriverDropOffLongitude = (HiddenField)list.FindControl("uodfDriverDropOffLongitude");
                    uodfDriverParkingLatitude  = (HiddenField)list.FindControl("uodfDriverParkingLatitude");
                    uodfDriverParkingLongitude = (HiddenField)list.FindControl("uodfDriverParkingLongitude");


                    Pickupdate      = (Label)list.FindControl("lblPickupDate");
                    PickupTime      = (TextBox)list.FindControl("txtPickupTime");
                    PickupLocation  = (TextBox)list.FindControl("txtPickupLocation");
                    DropOffLocation = (TextBox)list.FindControl("txtDropOffLocation");

                    if (GlobalCode.Field2Int(uoDropDownListDriver.SelectedIndex) > 0)
                    {
                        dr = dtparam.NewRow();
                        dr["DriverRequestID"] = GlobalCode.Field2Long(DriverRequestID.Value);
                        dr["UserID"]          = uoDropDownListDriver.SelectedItem.Value;
                        dr["PickupDate"]      = GlobalCode.Field2DateTime(Pickupdate.Text);
                        dr["PickupTime"]      = GlobalCode.Field2DateTime(PickupTime.Text);

                        dr["ParkingLocation"]  = GlobalCode.Field2String(uoTextBoxPakingLocation.Text);
                        dr["ParkingLatitude"]  = GlobalCode.Field2Double(uodfDriverParkingLatitude.Value);
                        dr["ParkingLongitude"] = GlobalCode.Field2Double(uodfDriverParkingLongitude.Value);

                        dr["PickupLocation"]  = GlobalCode.Field2String(PickupLocation.Text);
                        dr["PickupLatitude"]  = GlobalCode.Field2Double(uodfDriverPickupLatitude.Value);
                        dr["PickupLongitude"] = GlobalCode.Field2Double(uodfDriverPickupLongitude.Value);

                        dr["DropOffLocation"]  = GlobalCode.Field2String(DropOffLocation.Text);
                        dr["DropOffLatitude"]  = GlobalCode.Field2Double(uodfDriverDropOffLatitude.Value);
                        dr["DropOffLongitude"] = GlobalCode.Field2Double(uodfDriverParkingLongitude);

                        dr["VehicleDetailID"]     = GlobalCode.Field2Int(uoHiddenFieldVehicleHotelSPID.Value);
                        dr["ConfirmedManifestID"] = GlobalCode.Field2Long(ConfirmedManifestID.Value);

                        dtparam.Rows.Add(dr);
                    }


                    if (GlobalCode.Field2Int(uoDropDownListGreeter.SelectedIndex) > 0)
                    {
                        dr = gtparam.NewRow();
                        dr["GreeterRequestID"]    = GlobalCode.Field2Long(DriverRequestID.Value);
                        dr["UserID"]              = uoDropDownListGreeter.SelectedItem.Value;
                        dr["PickupDate"]          = GlobalCode.Field2DateTime(Pickupdate.Text);
                        dr["PickupTime"]          = GlobalCode.Field2DateTime(PickupTime.Text);
                        dr["PickupLocation"]      = GlobalCode.Field2String(PickupLocation.Text);
                        dr["PickupLatitude"]      = GlobalCode.Field2Double(uodfGreeterPickupLatitude.Value);
                        dr["PickupLongitude"]     = GlobalCode.Field2Double(uodfGreeterPickupLongitude.Value);
                        dr["DropOffLocation"]     = GlobalCode.Field2String(DropOffLocation.Text);
                        dr["DropOffLatitude"]     = GlobalCode.Field2Double(uodfGreeterDropOffLatitude.Value);
                        dr["DropOffLongitude"]    = GlobalCode.Field2Double(uodfGreterDropOffLongitude.Value);
                        dr["ConfirmedManifestID"] = GlobalCode.Field2Long(ConfirmedManifestID.Value);
                        gtparam.Rows.Add(dr);
                    }
                }

                BLL.SaveDriverTransaction(GlobalCode.Field2Int(uoHiddenFieldVendorID.Value), uoHiddenFieldsUserID.Value, uoHiddenFieldcmfid.Value, dtparam, gtparam);


                OpenParentPage("Created successfully.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }