/// <summary>
        /// Date Created:   06/10/2011
        /// Created By:     Gabriel Oquialda
        /// (description)   Insert/Update vehicle type for branch
        /// </summary>
        protected void uoButtonSaveVehicleType_Click(object sender, EventArgs e)
        {
            string strLogDescription;
            string strFunction;

            Int32 pVehicleID = VendorMaintenanceBLL.vehicleInsertUpdateVehicleTypeBranch(Convert.ToInt32(uoHiddenFieldVehicleId.Value), Convert.ToInt32(uoDropDownListVehicleType.SelectedValue), uoTextBoxVehicleTypeName.Text,
                                                                                         Convert.ToInt32(uoHiddenFieldBranchId.Value), Convert.ToInt32(uoTextBoxVehicleCapacity.Text), GlobalCode.Field2String(Session["UserName"]));

            if (Request.QueryString["vID"] == "0" || Request.QueryString["vID"] == null)
            {
                //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                strLogDescription = "Vehicle type added.";
                strFunction       = "uoButtonSaveVehicleType_Click";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                BLL.AuditTrailBLL.InsertLogAuditTrail(pVehicleID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
            }
            else
            {
                //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                strLogDescription = "Vehicle type updated.";
                strFunction       = "uoButtonSaveVehicleType_Click";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                BLL.AuditTrailBLL.InsertLogAuditTrail(pVehicleID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
            }

            OpenParentPage();
        }
Пример #2
0
 /// <summary>
 /// Date Created: 07/10/2011
 /// Created By: Gabriel Oquialda
 /// (description) Loads vendor type branch information
 /// </summary>
 private void vehicleTypeBranchInfoLoad(String branchId)
 {
     if (branchId != "0" && branchId != null)
     {
         uoListViewVehicle.DataSource = VendorMaintenanceBLL.GetVehicleTypeBranchList(Int32.Parse(branchId));
         uoListViewVehicle.DataBind();
     }
 }
        public void GetColor()
        {
            List <ColorCodes>    listColor = new List <ColorCodes>();
            VendorMaintenanceBLL BLL       = new VendorMaintenanceBLL();

            listColor = BLL.GetColor();
            uoListViewColor.DataSource = listColor;
            uoListViewColor.DataBind();
        }
Пример #4
0
        /// <summary>
        /// Date Created:   01/08/2011
        /// Created By:     Gabriel Oquialda
        /// (description)   Loads vendor information
        /// -----------------------------------------
        /// Date Modified:  28/11/2011
        /// Modified By:    Charlene Remotigue
        /// (description)   optimization (use datareader instead of datatable
        /// -----------------------------------------
        /// Date Modified:  24/01/2012
        /// Modified By:    Josephine Gad
        /// (description)   Close IDataReader and add cityname in textbox
        ///                 Disable uoTextBoxVendorCode if there is value
        /// </summary>
        private void vendorInfoLoad()
        {
            IDataReader drVendorInfo = null;

            try
            {
                if (Request.QueryString["vmId"].ToString() != "0")
                {
                    drVendorInfo = VendorMaintenanceBLL.vendorMaintenanceInformation(GlobalCode.Field2Int(uoHiddenFieldVendorIdInt.Value));
                    if (drVendorInfo.Read())
                    {
                        uoTextBoxVendorCode.Text = drVendorInfo["colVendorCodeVarchar"].ToString();
                        if (uoTextBoxVendorCode.Text.Trim() != "")
                        {
                            uoTextBoxVendorCode.CssClass = "ReadOnly";
                            uoTextBoxVendorCode.ReadOnly = true;
                        }
                        uoTextBoxVendorName.Text = drVendorInfo["colVendorNameVarchar"].ToString();

                        string strVendorType = drVendorInfo["colVendorTypeVarchar"].ToString();
                        uoHiddenFieldVendorType.Value = strVendorType;

                        //string strHotelCategory = drVendorInfo.Rows[0]["colVendorHotelCategoryVarchar"].ToString();
                        //uoDropDownListHotelCategory.SelectedValue = strHotelCategory;

                        uoTextBoxVendorAddress.Text = drVendorInfo["colAddressVarchar"].ToString();

                        uoDropDownListCountry.SelectedValue = drVendorInfo["colCountryIDInt"].ToString();
                        uoTextBoxCityName.Text = drVendorInfo["colCityNameVarchar"].ToString();
                        if (uoDropDownListCountry.SelectedIndex > 1)
                        {
                            vendorCityLoad(Convert.ToInt32(uoDropDownListCountry.SelectedValue));
                        }
                        uoDropDownListCity.SelectedValue = drVendorInfo["colCityIDInt"].ToString();

                        uoTextBoxPerson.Text    = drVendorInfo["colContactPersonVarchar"].ToString();
                        uoTextBoxContactNo.Text = drVendorInfo["colContactNoVarchar"].ToString();
                        //uoCheckBoxVendorAccredited.Checked = Convert.ToBoolean(drVendorInfo["colIsAccreditedBit"].ToString());

                        ChangeToUpperCase(uoDropDownListCountry);
                        ChangeToUpperCase(uoDropDownListCity);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (drVendorInfo != null)
                {
                    drVendorInfo.Close();
                    drVendorInfo.Dispose();
                }
            }
        }
Пример #5
0
        /// <summary>
        /// Date Created: 06/10/2011
        /// Created By: Gabriel Oquialda
        /// (description) Insert/Update vendor vehicle branch
        /// </summary>
        protected void uoButtonVehicleBranchSave_Click(object sender, EventArgs e)
        {
            string vendorId = uoDropDownListVendorName.SelectedValue;
            string country  = uoDropDownListCountry.SelectedValue;
            string city     = uoDropDownListCity.SelectedValue;

            string strLogDescription;
            string strFunction;

            bool isValidTest = false;

            Validate("Header");
            isValidTest = IsValid;

            if (!isValidTest)
            {
                return;
            }

            VendorMaintenanceBLL.vehicleInsertUpdateVendorBranch(uoTextBoxVendorBranchName.Text, uoTextBoxBranchCode.Text, uoTextBoxVendorAddress.Text, Convert.ToInt32(city), Convert.ToInt32(country),
                                                                 uoTextBoxContactNo.Text, GlobalCode.Field2String(Session["UserName"]), Convert.ToInt32(vendorId), uoTextBoxContactPerson.Text,
                                                                 uoCheckBoxFranchise.Checked, uoHiddenFieldBranchId.Value, GlobalCode.Field2TinyInt(uoRadioButtonListType.SelectedValue));

            if (Request.QueryString["vmId"] == "0" || Request.QueryString["vmId"] == null)
            {
                //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                strLogDescription = "Vehicle vendor branch added.";
                strFunction       = "uoButtonVehicleBranchSave_Click";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path),
                //                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
            }
            else
            {
                //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                strLogDescription = "Vehicle vendor branch updated.";
                strFunction       = "uoButtonVehicleBranchSave_Click";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path),
                //                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
            }


            //if (Request.QueryString["vmId"] == "0")
            //{
            Response.Redirect("~/Maintenance/VehicleMaintenanceBranchView.aspx?st=" + Request.QueryString["st"] + "&dt=" + Request.QueryString["dt"] + "&ufn=" + Request.QueryString["ufn"]);
            //}
        }
 /// <summary>
 /// Date Created: 06/10/2011
 /// Created By: Gabriel Oquialda
 /// (description) Loads vehicle type branch information
 /// </summary>
 private void vehicleTypeBranchInfoLoad(String vehicleId)
 {
     if (vehicleId != "0")
     {
         DataTable dtVendorInfo = VendorMaintenanceBLL.vehicleTypeBranchInfoLoad(Int32.Parse(vehicleId));
         if (dtVendorInfo.Rows.Count > 0)
         {
             uoDropDownListVehicleType.SelectedValue = dtVendorInfo.Rows[0]["colVehicleTypeIdInt"].ToString();
             uoTextBoxVehicleTypeName.Text           = dtVendorInfo.Rows[0]["colVehicleNameVarchar"].ToString();
             uoTextBoxVehicleCapacity.Text           = dtVendorInfo.Rows[0]["colVehicleCapacityInt"].ToString();
         }
     }
 }
 private void SaveHotel()
 {
     try
     {
         Int32 iBranchID = GlobalCode.Field2Int(uoHiddenFieldBranchID.Value);
         VendorMaintenanceBLL.vendorBranchMaintenanceUpdate(iBranchID, uoTextBoxInstructionOn.Text,
                                                            uoTextBoxInstructionOff.Text, "Update Hotel Instruction", "SaveHotel", Path.GetFileName(Request.Path),
                                                            CommonFunctions.GetDateTimeGMT(CommonFunctions.GetCurrentDateTime()), DateTime.Now, uoHiddenFieldUser.Value);
     }
     catch (Exception ex)
     {
         AlertMessage(ex.Message, true);
     }
 }
        private void GetAirportsOfVendor()
        {
            DataTable dt = new DataTable();


            string serviceProvider = GlobalCode.Field2String(Request.QueryString["pid"]);

            dt = VendorMaintenanceBLL.GetServiceProviderAirportbyBrand(serviceProvider);
            if (dt.Rows.Count > 0)
            {
                uoListViewAirport.DataSource = dt;
                uoListViewAirport.DataBind();
            }
        }
Пример #9
0
        ///// <summary>
        ///// Date Created:   24/08/2011
        ///// Created By:     Gabriel Oquialda
        ///// (description)   Load vehicle type to dropdownlist
        ///// ----------------------------------------------------
        ///// Date Modified:  06/09/2011
        ///// Modified By:    Josephine Gad
        ///// (description)   Change vehicleGetType to vehicleGetTypeBrandMake
        ///// </summary>
        //private void vehicleGetType()
        //{
        //    DataTable dt = new DataTable();
        //    try
        //    {
        //        dt = VendorMaintenanceBLL.vehicleGetTypeList();
        //        if (dt.Rows.Count > 0)
        //        {
        //            uoDropDownListVehicleType.DataSource = dt;
        //            uoDropDownListVehicleType.DataTextField = "vehicleType";
        //            uoDropDownListVehicleType.DataValueField = "vehicleTypeID";
        //            uoDropDownListVehicleType.DataBind();
        //        }
        //        else
        //        {
        //            uoDropDownListVehicleType.DataBind();
        //        }

        //        uoDropDownListVehicleType.Items.Insert(0, new ListItem("--Select Vehicle Type--", "0"));

        //        if (dt.Rows.Count == 1)
        //        {
        //            uoDropDownListVehicleType.SelectedIndex = 1;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    finally
        //    {
        //        if (dt != null)
        //        {
        //            dt.Dispose();
        //        }
        //    }
        //}

        /// <summary>
        /// Date Created:   08/09/2011
        /// Created By:     Gabriel Oquialda
        /// (description)   Loads vendor branch information
        /// ---------------------------------------------------
        /// Date Modified:  27/11/2011
        /// Modified By:    Josephine Gad
        /// (description)   Change DataTable to IDataReader
        /// </summary>
        private void vehicleVendorBranchInfoLoad(String branchId)
        {
            IDataReader dr = null;

            try
            {
                if (branchId != "0" && branchId != null)
                {
                    dr = VendorMaintenanceBLL.vehicleVendorBranchMaintenanceInformation(Int32.Parse(branchId));
                    if (dr.Read())
                    {
                        uoDropDownListVendorName.Enabled       = false;
                        uoDropDownListVendorName.SelectedValue = dr["colVendorIdInt"].ToString();
                        uoTextBoxVendorBranchName.Text         = dr["colVendorBranchNameVarchar"].ToString();

                        uoTextBoxVendorAddress.Text = dr["colAddressVarchar"].ToString();

                        uoDropDownListCountry.SelectedValue = dr["colCountryIDInt"].ToString();
                        uoTextBoxFilterCity.Text            = dr["colCityNameVarchar"].ToString();
                        if (uoDropDownListCountry.SelectedIndex > 1)
                        {
                            cityListByCountry(Convert.ToInt32(uoDropDownListCountry.SelectedValue));
                        }
                        uoDropDownListCity.SelectedValue = dr["colCityIDInt"].ToString();
                        uoTextBoxContactNo.Text          = dr["colContactNoVarchar"].ToString();
                        uoTextBoxContactPerson.Text      = dr["colContactPersonVarchar"].ToString();
                        uoCheckBoxFranchise.Checked      = Convert.ToBoolean(dr["colFranchiseBit"].ToString());

                        uoRadioButtonListType.SelectedValue = dr["colVehicleTypeTinyInt"].ToString();

                        textChangeToUpperCase(uoDropDownListCountry);
                        textChangeToUpperCase(uoDropDownListCity);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                    dr.Dispose();
                }
            }
        }
Пример #10
0
 private void getVendorType()
 {
     try
     {
         DataTable dr;
         dr = VendorMaintenanceBLL.getVendorType(0);
         uoRadioButtonListType.DataSource     = dr;
         uoRadioButtonListType.DataTextField  = "colVendorTypeNameVarchar";
         uoRadioButtonListType.DataValueField = "colVendorTypeIdInt";
         uoRadioButtonListType.DataBind();
     }
     catch
     {
         throw;
     }
 }
        /// <summary>
        /// Date Created:   10/Nov/2017
        /// Created By:     JGM
        /// (description)   Load Hotel Info of user
        /// </summary>
        private void VendorBranchInfoLoad()
        {
            List <HotelBranchDetails> listHotel = new List <HotelBranchDetails>();

            int iHotelId = GlobalCode.Field2Int(uoHiddenFieldBranchID.Value);

            if (iHotelId > 0)
            {
                VendorMaintenanceBLL.vendorBranchMaintenanceInformation(iHotelId);
                listHotel = (List <HotelBranchDetails>)Session["HotelMaintenance_HotelDetails"];
                if (listHotel.Count > 0)
                {
                    uoTextBoxInstructionOn.Text  = listHotel[0].InstructionOn;
                    uoTextBoxInstructionOff.Text = listHotel[0].InstructionOff;
                }
            }
        }
        /// <summary>
        /// Date Created:   08/Aug/2013
        /// Created By:     Josephine gad
        /// (description)   Get ListView of Vendor Vehicle Type
        /// </summary>
        private List <VendorVehicleType> GetVehicleVendorTypeList(int iLoadType)
        {
            List <VendorVehicleType> list = new List <VendorVehicleType>();

            if (iLoadType == 0)
            {
                if (Session["MeetAndGreetAirport"] != null)
                {
                    list = (List <VendorVehicleType>)Session["MeetAndGreetAirport"];
                }
            }
            else
            {
                VendorMaintenanceBLL.VehicleVendorsTypeGet(GlobalCode.Field2Int(uoHiddenFieldVehicleVendorIdInt.Value));
                list = (List <VendorVehicleType>)Session["MeetAndGreetAirport"];
            }
            return(list);
        }
        /// <summary>
        /// Date Created:   07/Nov/2013
        /// Created By:     Josephine Gad
        /// (description)   Get ListView of Plate No.
        /// </summary>
        private List <VehiclePlate> GetVehicleVendorPlateNo(int iLoadType)
        {
            List <VehiclePlate> list = new List <VehiclePlate>();

            if (iLoadType == 0)
            {
                if (Session["VendorVehiclePlate"] != null)
                {
                    list = (List <VehiclePlate>)Session["VendorVehiclePlate"];
                }
            }
            else
            {
                list = VendorMaintenanceBLL.VehicleVendorsPlateNoGet(GlobalCode.Field2Int(uoHiddenFieldVehicleVendorIdInt.Value));
                Session["VendorVehiclePlate"] = list;
            }
            return(list);
        }
        /// <summary>
        /// Date Created:   12/Nov/2013
        /// Created By:     Josephine gad
        /// (description)   Get ListView of PortAgent Vehicle Type
        /// </summary>
        private List <PortAgentVehicleType> GetPortAgentVehicleTypeList(int iLoadType)
        {
            List <PortAgentVehicleType> list = new List <PortAgentVehicleType>();

            if (iLoadType == 0)
            {
                if (Session["PortAgentVehicleType"] != null)
                {
                    list = (List <PortAgentVehicleType>)Session["PortAgentVehicleType"];
                }
            }
            else
            {
                VendorMaintenanceBLL.GetPortAgentVehicleType(GlobalCode.Field2Int(uoHiddenFieldPortAgentIdInt.Value));
                list = (List <PortAgentVehicleType>)Session["PortAgentVehicleType"];
            }
            return(list);
        }
        private void BindPortAgentDetails()
        {
            VendorMaintenanceBLL.GetPortAgentAirportBrand(GlobalCode.Field2Int(uoHiddenFieldPortAgentIDInt.Value), 0);

            List <VendorPortAgentDetails> list        = new List <VendorPortAgentDetails>();
            List <AirportDTO>             listAirport = new List <AirportDTO>();

            uoTextBoxAirport.Text       = "";
            uoTextBoxPortAgentName.Text = "";
            string[] sAirportArr = null;

            if (uoHiddenFieldAirportID.Value != "" && uoHiddenFieldAirportID.Value != "0")
            {
                sAirportArr = uoHiddenFieldAirportID.Value.Split("-".ToCharArray());
            }

            if (Session["PortAgentVendorDetails"] != null)
            {
                list = (List <VendorPortAgentDetails>)Session["PortAgentVendorDetails"];
                if (list.Count > 0)
                {
                    uoTextBoxPortAgentName.Text = list[0].PortAgentName;

                    if (Session["PortAgentAirport"] != null)
                    {
                        listAirport = (List <AirportDTO>)Session["PortAgentAirport"];
                        if (listAirport.Count > 0)
                        {
                            foreach (AirportDTO item in listAirport)
                            {
                                if (uoTextBoxAirport.Text != "")
                                {
                                    uoTextBoxAirport.Text += ", ";
                                }
                                if (sAirportArr.Contains(item.AirportIDString))
                                {
                                    //uoTextBoxAirport.Text += item.AirportCodeString;
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #16
0
        /// <summary>
        /// Date Created: 29/07/2011
        /// Created By: Gabriel Oquialda
        /// Description: Save vendor
        /// </summary>
        protected void uoButtonSave_Click(object sender, EventArgs e)
        {
            try
            {
                string strLogDescription;
                string strFunction;

                //string vendorPrimaryId = (VendorMaintenanceVariables.vendorPrimaryIdString == null) ? "" : VendorMaintenanceVariables.vendorPrimaryIdString;
                string vendorPrimaryId = uoHiddenFieldVendorIdInt.Value;

                Int32 VendorID = VendorMaintenanceBLL.vendorMaintenanceInsert(uoTextBoxVendorCode.Text.ToUpper(), uoTextBoxVendorName.Text.ToUpper(), uoHiddenFieldVendorType.Value,
                                                                              uoTextBoxVendorAddress.Text, Convert.ToInt32(uoDropDownListCity.SelectedValue), Convert.ToInt32(uoDropDownListCountry.SelectedValue),
                                                                              uoTextBoxContactNo.Text, GlobalCode.Field2String(Session["UserName"]), vendorPrimaryId, uoTextBoxPerson.Text);

                if (vendorPrimaryId == "0" || vendorPrimaryId == "")
                {
                    //Insert log audit trail (Gabriel Oquialda - 16/11/2011)
                    strLogDescription = "Hotel vendor added.";
                    strFunction       = "uoButtonSave_Click";

                    DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                    BLL.AuditTrailBLL.InsertLogAuditTrail(VendorID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                          CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                }
                else
                {
                    //Insert log audit trail (Gabriel Oquialda - 16/11/2011)
                    strLogDescription = "Hotel vendor updated.";
                    strFunction       = "uoButtonSave_Click";

                    DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                    BLL.AuditTrailBLL.InsertLogAuditTrail(VendorID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                          CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                }

                OpenParentPage();
            }
            catch (Exception ex)
            {
                AlertMessage(ex.Message);
            }
        }
        /// <summary>
        /// Date Created:   05/Nov/2013
        /// Created By:     Josephine gad
        /// (description)   Get ListView of Airport not yet assigned to Service Provider
        /// </summary>
        private List <AirportDTO> GetAirportNotExist(int iLoadType)
        {
            List <AirportDTO> list = new List <AirportDTO>();

            if (iLoadType == 0)
            {
                if (Session["PortAgentAirportNotExist"] != null)
                {
                    list = (List <AirportDTO>)Session["PortAgentAirportNotExist"];
                }
            }
            else
            {
                VendorMaintenanceBLL.GetPortAgentAirport(GlobalCode.Field2Int(uoHiddenFieldPortAgentIdInt.Value));
                list = (List <AirportDTO>)Session["PortAgentAirportNotExist"];
            }

            return(list);
        }
Пример #18
0
        /// <summary>
        /// Date Created:   24/08/2011
        /// Created By:     Gabriel Oquialda
        /// (description)   Load vehicle type to dropdownlist
        /// ----------------------------------------------------
        /// Date Modified:  06/09/2011
        /// Modified By:    Josephine Gad
        /// (description)   Change vehicleGetType to vehicleGetTypeBrandMake
        /// </summary>
        private void vehicleGetType()
        {
            DataTable dt = new DataTable();

            try
            {
                dt = VendorMaintenanceBLL.vehicleGetTypeList();
                if (dt.Rows.Count > 0)
                {
                    uoDropDownListVehicleType.DataSource     = dt;
                    uoDropDownListVehicleType.DataTextField  = "vehicleType";
                    uoDropDownListVehicleType.DataValueField = "vehicleTypeID";
                    uoDropDownListVehicleType.DataBind();
                }
                else
                {
                    uoDropDownListVehicleType.DataBind();
                }

                uoDropDownListVehicleType.Items.Insert(0, new ListItem("--Select Vehicle Type--", "0"));

                if (dt.Rows.Count == 1)
                {
                    uoDropDownListVehicleType.SelectedIndex = 1;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
        /// <summary>
        /// Date Created: 06/27/2014
        /// Created By:   Michael Brian C. Evangelista
        /// Description:  Add Airports for vendor brand
        /// </summary>

        private void SearchAirport()
        {
            DataTable dt  = new DataTable();
            DataTable dt2 = new DataTable();


            string uoSearchFieldAirport = uoSearchAirportBox.Text;
            string serviceProvider      = GlobalCode.Field2String(Request.QueryString["pid"]);

            dt  = VendorMaintenanceBLL.GetServiceProviderAirportbyBrand(serviceProvider);
            dt2 = dt.Clone();
            if (dt.Rows.Count > 0)
            {
                for (var f = 0; f < dt.Rows.Count; f++)
                {
                    string temp         = dt.Rows[f]["colAirportFullName"].ToString();
                    int    tempColCount = temp.Length;
                    string tempSearch   = temp.ToLower();
                    bool   searchTerm   = tempSearch.Substring(0, tempColCount).Contains(uoSearchFieldAirport.ToLower());

                    if (searchTerm)
                    {
                        dt2.ImportRow(dt.Rows[f]);
                    }
                }
                if (dt2.Rows.Count > 0)
                {
                    uoListViewAirport.DataSource = dt2;
                    uoListViewAirport.DataBind();
                }
                else
                {
                    uoListViewAirport.DataSource = dt;
                    uoListViewAirport.DataBind();
                }
            }
        }
        /// <summary>
        /// Date Created: 27/07/2011
        /// Created By: Gabriel Oquialda
        /// (description) Save new vendor
        /// -------------------------------------------
        /// Date Modified:  05/Aug/2013
        /// Created By:     Josephine Gad
        /// (description)   Change endorMaintenanceBLL.vendorMaintenanceInsert to endorMaintenanceBLL.PortAgentsSave
        ///                 Add Audit Trail in the same script
        ///                 Remove the separate Audit Trail
        /// </summary>
        protected void uoButtonSave_Click(object sender, EventArgs e)
        {
            DataTable dtAirport     = null;
            DataTable dtVehicleType = null;

            try
            {
                string   strLogDescription;
                string   strFunction = "uoButtonSave_Click";
                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                if (GlobalCode.Field2Int(uoHiddenFieldPortAgentIdInt.Value) == 0)
                {
                    strLogDescription = "Service Provider  vendor added.";
                }
                else
                {
                    strLogDescription = "Service Provider vendor updated.";
                }

                string vendorPrimaryId = GlobalCode.Field2Int(uoHiddenFieldPortAgentIdInt.Value).ToString();//(Session["vendorPrimaryId"].ToString() == null) ? "0" : Session["vendorPrimaryId"].ToString();

                //Airport Table
                dtAirport = new DataTable();
                dtAirport.Columns.Add("AirportCode", typeof(string));

                DataRow     r;
                HiddenField hiddenFieldAirport;

                foreach (ListViewItem item in uoListViewAirport.Items)
                {
                    r = dtAirport.NewRow();
                    hiddenFieldAirport = (HiddenField)item.FindControl("uoHiddenFieldAirportID");
                    r[0] = hiddenFieldAirport.Value;
                    dtAirport.Rows.Add(r);
                }

                //Vehicle Type Table
                dtVehicleType = new DataTable();
                dtVehicleType.Columns.Add("VehicleTypeID", typeof(int));

                DataRow     rVehicleType;
                HiddenField hiddenFieldVehicleTypeID;

                foreach (ListViewItem item in uoListViewVehicleType.Items)
                {
                    rVehicleType             = dtVehicleType.NewRow();
                    hiddenFieldVehicleTypeID = (HiddenField)item.FindControl("uoHiddenFieldVehicleTypeID");
                    rVehicleType[0]          = GlobalCode.Field2Int(hiddenFieldVehicleTypeID.Value);
                    dtVehicleType.Rows.Add(rVehicleType);
                }

                VendorMaintenanceBLL.PortAgentVendorsSave(GlobalCode.Field2Int(vendorPrimaryId),
                                                          uoTextBoxVendorName.Text.Trim(), GlobalCode.Field2Int(uoDropDownListCountry.SelectedValue),
                                                          GlobalCode.Field2Int(uoDropDownListCity.SelectedValue), uoTextBoxContactNo.Text,
                                                          uoTextBoxFaxNo.Text, uoTextBoxContactPerson.Text, uoTextBoxVendorAddress.Text,
                                                          uoTextBoxEmailCc.Text, uoTextBoxEmailTo.Text, uoTextBoxWebsite.Text, uoTextBoxVendorID.Text.Trim(),
                                                          uoHiddenFieldUser.Value, strLogDescription, strFunction,
                                                          Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now,
                                                          dtAirport, dtVehicleType);

                AlertMessage("Save successfully.", true);
                //Response.Redirect(uoHiddenFieldURLFrom.Value +"?ufn=" + Request.QueryString["ufn"] + "&dt=" + Request.QueryString["dt"]);
                Response.Redirect(uoHiddenFieldURLFrom.Value);
            }
            catch (Exception ex)
            {
                AlertMessage(ex.Message, true);
            }
            finally
            {
                if (dtAirport != null)
                {
                    dtAirport.Dispose();
                }
                if (dtVehicleType != null)
                {
                    dtVehicleType.Dispose();
                }
            }
        }
Пример #21
0
        /// <summary>
        /// Date Created:   28/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Approve/disapprove selected request
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void ApproveRequest()
        {
            IDataReader dr     = null;
            DataTable   dTable = null;

            try
            {
                string strLogDescription;
                string strFunction;

                string ApproveByString = GlobalCode.Field2String(Session["UserName"]);;
                foreach (ListViewItem item in uoListViewVehicle.Items)
                {
                    CheckBox CheckSelect    = (CheckBox)item.FindControl("uoCheckBoxSelect");
                    bool     IsApprovedBool = CheckSelect.Checked;

                    if (IsApprovedBool)
                    {
                        HiddenField HiddenID     = (HiddenField)item.FindControl("uoHiddenFieldIdBigInt");
                        HiddenField BranchID     = (HiddenField)item.FindControl("uoHiddenFieldBranchIDInt");
                        Label       VehiclelName = (Label)item.FindControl("uoLabelVehicleName");
                        Label       E1ID         = (Label)item.FindControl("uoLabelE1ID");
                        Label       Pickupdate   = (Label)item.FindControl("uoLabelPickupDate");
                        LinkButton  Name         = (LinkButton)item.FindControl("SeafarerLinkButton");
                        string      pendingID    = HiddenID.Value;

                        dTable = VehicleBLL.vehicleApproveTransaction(pendingID, ApproveByString);
                        dr     = VendorMaintenanceBLL.vehicleVendorBranchMaintenanceInformation(Int32.Parse(BranchID.Value));
                        if (dr.Read())
                        {
                            string sMsg = "Booking of seafarer <b>" + Name.Text + "</b> with E1 ID <b>" + E1ID.Text + "</b> has been approved. <br/><br/>";
                            sMsg += "Vehicle Branch: " + VehiclelName.Text + "<br/>";
                            sMsg += "Pickup Date: " + Pickupdate.Text + "";
                            sMsg += "<br/><br/>Thank you.";
                            sMsg += "<br/><br/><i>Auto generated email.</i>";

                            SendEmail("Travelmart: Pending Vehicle Booking Approval", sMsg, dr["colCountryIDInt"].ToString(), BranchID.Value);
                        }

                        //Insert log audit trail (Gabriel Oquialda - 15/11/2011)
                        strLogDescription = "Vehicle pending transaction approved.";
                        strFunction       = "ApproveRequest";

                        DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                        BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(dTable.Rows[0]["PK"].ToString()), dTable.Rows[0]["SeqNum"].ToString(), strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                              CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                    }
                }
                AlertMessage("Approved!");

                GetSFVehicleTravelDetails();
            }
            catch (Exception ex)
            {
                AlertMessage(ex.Message);
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                    dr.Dispose();
                }
            }
        }
        private void GetAirportsOFVendorSaved()
        {
            DataTable dt = new DataTable();

            string serviceProvider = GlobalCode.Field2String(Request.QueryString["pid"]);

            dt = VendorMaintenanceBLL.GetServiceProviderAirportbyVendor(serviceProvider);
            if (dt.Rows.Count > 0)
            {
                uoListViewAirportSaved.DataSource = dt;
                uoListViewAirportSaved.DataBind();
            }
            else
            {
                DateTime date = DateTime.Now;
                dt.Rows.Add(new Object[] { 1, 1, " ", " No Record", " ", date, " ", date, 1, 1, 1, "No Record" });
                uoListViewAirportSaved.DataSource = dt;
                uoListViewAirportSaved.DataBind();
            }

            //for brand checkboxes
            if (dt.Rows.Count > 0)
            {
                for (var f = 0; f < dt.Rows.Count; f++)
                {
                    string teststringg = dt.Rows[f]["colBrandIdInt"].ToString();
                    if (teststringg == "1")
                    {
                        ListItem listItem = this.uoCheckBoxListBrand.Items.FindByText("RCI");

                        if (listItem != null)
                        {
                            listItem.Selected = true;
                        }
                    }
                    else if (teststringg == "2")
                    {
                        ListItem listItem = this.uoCheckBoxListBrand.Items.FindByText("AZA");

                        if (listItem != null)
                        {
                            listItem.Selected = true;
                        }
                    }
                    else if (teststringg == "3")
                    {
                        ListItem listItem = this.uoCheckBoxListBrand.Items.FindByText("CEL");

                        if (listItem != null)
                        {
                            listItem.Selected = true;
                        }
                    }
                    else if (teststringg == "4")
                    {
                        ListItem listItem = this.uoCheckBoxListBrand.Items.FindByText("PUL");

                        if (listItem != null)
                        {
                            listItem.Selected = true;
                        }
                    }
                }
            }
        }
        private void RemoveAirport()
        {
            CheckBox    uoCheckBoxSelect;
            HiddenField uoHiddenFieldAirport;
            Label       uoLabelAirport;

            DataTable dt  = new DataTable();
            DataTable dt2 = new DataTable();
            DataTable dt3 = new DataTable();

            string serviceProvider = GlobalCode.Field2String(Request.QueryString["pid"]);

            dt  = VendorMaintenanceBLL.GetServiceProviderAirportbyBrand(serviceProvider);
            dt2 = VendorMaintenanceBLL.GetServiceProviderAirportbyVendor(serviceProvider);

            /// check if there is already a an existing datatable using session

            if (Session["AirportContainer"] != null)
            {
                dt3 = (DataTable)Session["AirportContainer"];
                dt  = (DataTable)Session["AirportList"];
            }
            else
            {
                dt3 = dt2.Clone();
                dt3 = dt2.Copy();
            }

            foreach (ListViewItem item in uoListViewAirportSaved.Items)
            {
                uoCheckBoxSelect = (CheckBox)item.FindControl("uoCheckBoxSelectSaved");
                if (uoCheckBoxSelect.Checked == true)
                {
                    uoHiddenFieldAirport = (HiddenField)item.FindControl("uoHiddenFieldAirportSaved");
                    uoLabelAirport       = (Label)item.FindControl("uoLabelAirportSaved");

                    string HiddenFieldAirport = GlobalCode.Field2String(uoHiddenFieldAirport.Value);

                    for (var f = 0; f < dt3.Rows.Count; f++)
                    {
                        if (dt3.Rows[f]["colAirportIDInt"].ToString() == HiddenFieldAirport)
                        {
                            dt.ImportRow(dt3.Rows[f]);
                            dt3.Rows.RemoveAt(f);
                        }
                    }
                }
            }
            if (dt3.Rows.Count > 0)
            {
                dt3.DefaultView.Sort = "colAirportIDInt ASC";
                dt3 = dt3.DefaultView.ToTable();
                uoListViewAirportSaved.DataSource = dt3;
                uoListViewAirportSaved.DataBind();

                dt.DefaultView.Sort = "colAirportIDInt ASC";
                dt = dt.DefaultView.ToTable();
                uoListViewAirport.DataSource = dt;
                uoListViewAirport.DataBind();

                Session["AirportContainer"] = dt3;
                Session["AirportList"]      = dt;
            }
        }
        /// <summary>
        /// Date Created: 27/07/2011
        /// Created By: Gabriel Oquialda
        /// (description) Save new vendor
        /// -------------------------------------------
        /// Date Modified:  05/Aug/2013
        /// Created By:     Josephine Gad
        /// (description)   Change endorMaintenanceBLL.vendorMaintenanceInsert to endorMaintenanceBLL.VehicleVendorsSave
        ///                 Add Audit Trail in the same script
        ///                 Remove the separate Audit Trail
        /// </summary>
        protected void uoButtonSave_Click(object sender, EventArgs e)
        {
            DataTable dt        = null;
            DataTable dtPlateNo = null;

            try
            {
                string   strLogDescription;
                string   strFunction = "uoButtonSave_Click";
                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                if (GlobalCode.Field2Int(uoHiddenFieldVehicleVendorIdInt.Value) == 0)
                {
                    strLogDescription = "Vehicle vendor added.";
                }
                else
                {
                    strLogDescription = "Vehicle vendor updated.";
                }

                string vendorPrimaryId = GlobalCode.Field2Int(uoHiddenFieldVehicleVendorIdInt.Value).ToString();//(Session["vendorPrimaryId"].ToString() == null) ? "0" : Session["vendorPrimaryId"].ToString();

                dt = new DataTable();
                dt.Columns.Add("VehicleTypeID", typeof(int));

                DataRow     r;
                HiddenField hiddenFieldVehicleTypeID;

                foreach (ListViewItem item in uoListViewVehicleType.Items)
                {
                    r = dt.NewRow();
                    hiddenFieldVehicleTypeID = (HiddenField)item.FindControl("uoHiddenFieldVehicleTypeID");
                    r[0] = GlobalCode.Field2Int(hiddenFieldVehicleTypeID.Value);
                    dt.Rows.Add(r);
                }

                dtPlateNo = new DataTable();

                dtPlateNo.Columns.Add("VehicleTypeID", typeof(int));
                dtPlateNo.Columns.Add("PlateNo", typeof(string));
                dtPlateNo.Columns.Add("VehicleMakeID", typeof(int));
                dtPlateNo.Columns.Add("VehicleColor", typeof(string));
                dtPlateNo.Columns.Add("VehicleColorName", typeof(string));

                DataRow     rPlateNo;
                HiddenField hiddenFieldVehicleTypeIDPlateNo;
                HiddenField uoHiddenFileVehicleMakeID;

                HiddenField uoHiddenFieldColor;
                HiddenField uoHiddenFieldColorName;

                Label labelPlateNo;
                foreach (ListViewItem item in uoListViewPlateNo.Items)
                {
                    rPlateNo = dtPlateNo.NewRow();

                    hiddenFieldVehicleTypeIDPlateNo = (HiddenField)item.FindControl("uoHiddenFieldVehicleTypeID");
                    uoHiddenFileVehicleMakeID       = (HiddenField)item.FindControl("uoHiddenFileVehicleMakeID");

                    uoHiddenFieldColor     = (HiddenField)item.FindControl("uoHiddenFieldColor");
                    uoHiddenFieldColorName = (HiddenField)item.FindControl("uoHiddenFieldColorName");

                    labelPlateNo = (Label)item.FindControl("uoLabelPlateNo");

                    rPlateNo[0] = GlobalCode.Field2Int(hiddenFieldVehicleTypeIDPlateNo.Value);
                    rPlateNo[1] = labelPlateNo.Text;
                    rPlateNo[2] = GlobalCode.Field2Int(uoHiddenFileVehicleMakeID.Value);
                    rPlateNo[3] = GlobalCode.Field2String(uoHiddenFieldColor.Value);
                    rPlateNo[4] = GlobalCode.Field2String(uoHiddenFieldColorName.Value);

                    dtPlateNo.Rows.Add(rPlateNo);
                }

                VendorMaintenanceBLL.VehicleVendorsSave(GlobalCode.Field2Int(vendorPrimaryId),
                                                        uoTextBoxVendorName.Text.Trim(), GlobalCode.Field2Int(uoDropDownListCountry.SelectedValue),
                                                        GlobalCode.Field2Int(uoDropDownListCity.SelectedValue), uoTextBoxContactNo.Text,
                                                        uoTextBoxFaxNo.Text, uoTextBoxContactPerson.Text, uoTextBoxVendorAddress.Text,
                                                        uoTextBoxEmailCc.Text, uoTextBoxEmailTo.Text, uoTextBoxWebsite.Text, uoTextBoxVendorID.Text.Trim(),
                                                        uoHiddenFieldUser.Value, strLogDescription, strFunction,
                                                        Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, dt, dtPlateNo);

                //OpenParentPage();
                AlertMessage("Save successfully.", true);
                //Response.Redirect("VehicleMaintenanceView.aspx?ufn=" + Request.QueryString["ufn"] + "&dt=" + Request.QueryString["dt"]);
                Response.Redirect(uoHiddenFieldURLFrom.Value);
            }
            catch (Exception ex)
            {
                AlertMessage(ex.Message, true);
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dtPlateNo != null)
                {
                    dtPlateNo.Dispose();
                }
            }
        }
        /// <summary>
        /// Date Created: 01/08/2011
        /// Created By: Gabriel Oquialda
        /// (decription) Loads vendor information
        /// -----------------------------------------------
        /// Date Created: 01/08/2011
        /// Created By: Gabriel Oquialda
        /// (decription) Loads vendor information
        /// -----------------------------------------------
        /// Date Modifed:   06/Aug/2013
        /// Created By:     Josephine Gad
        /// (decription)    Load Vendor using VendorMaintenanceBLL.VehicleVendorsGetByID
        ///                 Use Sessions instead of DataTable
        /// </summary>
        private void vendorInfoLoad(Int16 iLoadType)
        {
            if (Request.QueryString["vmId"].ToString() != "0")
            {
                VendorMaintenanceBLL.VehicleVendorsGetByID(GlobalCode.Field2Int(uoHiddenFieldVehicleVendorIdInt.Value), iLoadType);
                List <VendorVehicleDetails> listVehicleDetails = new List <VendorVehicleDetails>();

                if (Session["VehicleVendorDetails"] != null)
                {
                    listVehicleDetails = (List <VendorVehicleDetails>)Session["VehicleVendorDetails"];
                    if (listVehicleDetails.Count > 0)
                    {
                        uoTextBoxCity.Text          = GlobalCode.Field2String(Session["VehicleVendorCityFilter"]);
                        uoTextBoxVendorName.Text    = listVehicleDetails[0].VendorName;
                        uoTextBoxVendorAddress.Text = listVehicleDetails[0].Address;
                        uoTextBoxWebsite.Text       = listVehicleDetails[0].Website;

                        uoTextBoxEmailTo.Text = listVehicleDetails[0].EmailTo;
                        uoTextBoxEmailCc.Text = listVehicleDetails[0].EmailCC;

                        vendorCountryLoad();
                        if (uoDropDownListCountry.Items.FindByValue(GlobalCode.Field2String(listVehicleDetails[0].CountryID)) != null)
                        {
                            uoDropDownListCountry.SelectedValue = GlobalCode.Field2String(listVehicleDetails[0].CountryID);
                        }
                        vendorCityLoad(0, uoDropDownListCountry.SelectedValue);
                        if (uoDropDownListCity.Items.FindByValue(GlobalCode.Field2String(listVehicleDetails[0].CityID)) != null)
                        {
                            uoDropDownListCity.SelectedValue = GlobalCode.Field2String(listVehicleDetails[0].CityID);
                        }
                        uoTextBoxContactNo.Text     = listVehicleDetails[0].ContactNo;
                        uoTextBoxContactPerson.Text = listVehicleDetails[0].ContactPerson;
                        uoTextBoxFaxNo.Text         = listVehicleDetails[0].FaxNo;

                        BindVendorTypeList(0);
                        BindVehicleTypeList(0);
                        BindVehiclePlateNo(0);
                        BindVehicleMake();
                        BindVehicleBrand();

                        uoTextBoxVendorID.Text = listVehicleDetails[0].VendorIMS_ID;


                        PageAsyncTask TaskPort1 = new PageAsyncTask(OnBeginExceptions, OnEndExceptions, null, "Async1", true);
                        Page.RegisterAsyncTask(TaskPort1);
                    }
                }
                else
                {
                    uoTextBoxCity.Text          = "";
                    uoTextBoxVendorName.Text    = "";
                    uoTextBoxVendorAddress.Text = "";
                    uoTextBoxWebsite.Text       = "";

                    uoTextBoxEmailTo.Text = "";
                    uoTextBoxEmailCc.Text = "";

                    vendorCountryLoad();
                    vendorCityLoad(0, uoDropDownListCountry.SelectedValue);
                    uoTextBoxContactNo.Text     = "";
                    uoTextBoxContactPerson.Text = "";
                    uoTextBoxFaxNo.Text         = "";
                    uoTextBoxVendorID.Text      = "";

                    uoListViewVehicleType.DataSource = null;
                    uoListViewVehicleType.DataBind();
                    BindVehicleTypeList(1);
                    BindVehiclePlateNo(1);
                }
            }
            else
            {
                uoTextBoxCity.Text          = "";
                uoTextBoxVendorName.Text    = "";
                uoTextBoxVendorAddress.Text = "";
                uoTextBoxWebsite.Text       = "";

                uoTextBoxEmailTo.Text = "";
                uoTextBoxEmailCc.Text = "";

                vendorCountryLoad();
                vendorCityLoad(0, uoDropDownListCountry.SelectedValue);
                uoTextBoxContactNo.Text          = "";
                uoTextBoxContactPerson.Text      = "";
                uoTextBoxFaxNo.Text              = "";
                uoTextBoxVendorID.Text           = "";
                uoListViewVehicleType.DataSource = null;
                uoListViewVehicleType.DataBind();
                BindVehicleTypeList(1);
                BindVehiclePlateNo(1);
            }
        }
        /// <summary>
        /// Date Created: 01/08/2011
        /// Created By: Gabriel Oquialda
        /// (decription) Loads vendor information
        /// -----------------------------------------------
        /// Date Created: 01/08/2011
        /// Created By: Gabriel Oquialda
        /// (decription) Loads vendor information
        /// -----------------------------------------------
        /// Date Modifed:   06/Aug/2013
        /// Created By:     Josephine Gad
        /// (decription)    Load Vendor using VendorMaintenanceBLL.PortAgentsGetByID
        ///                 Use Sessions instead of DataTable
        /// </summary>
        private void vendorInfoLoad(Int16 iLoadType)
        {
            if (Request.QueryString["vmId"].ToString() != "0")
            {
                VendorMaintenanceBLL.GetPortAgentByID(GlobalCode.Field2Int(uoHiddenFieldPortAgentIdInt.Value), iLoadType);
                List <VendorPortAgentDetails> list = new List <VendorPortAgentDetails>();

                if (Session["PortAgentVendorDetails"] != null)
                {
                    list = (List <VendorPortAgentDetails>)Session["PortAgentVendorDetails"];
                    if (list.Count > 0)
                    {
                        uoTextBoxCity.Text          = GlobalCode.Field2String(Session["PortAgentVendorCityFilter"]);
                        uoTextBoxVendorName.Text    = list[0].PortAgentName;
                        uoTextBoxVendorAddress.Text = list[0].Address;
                        uoTextBoxWebsite.Text       = list[0].Website;

                        uoTextBoxEmailTo.Text = list[0].EmailTo;
                        uoTextBoxEmailCc.Text = list[0].EmailCC;

                        vendorCountryLoad();
                        if (uoDropDownListCountry.Items.FindByValue(GlobalCode.Field2String(list[0].CountryID)) != null)
                        {
                            uoDropDownListCountry.SelectedValue = GlobalCode.Field2String(list[0].CountryID);
                        }
                        vendorCityLoad(0, uoDropDownListCountry.SelectedValue);
                        if (uoDropDownListCity.Items.FindByValue(GlobalCode.Field2String(list[0].CityID)) != null)
                        {
                            uoDropDownListCity.SelectedValue = GlobalCode.Field2String(list[0].CityID);
                        }
                        uoTextBoxContactNo.Text     = list[0].ContactNo;
                        uoTextBoxContactPerson.Text = list[0].ContactPerson;
                        uoTextBoxFaxNo.Text         = list[0].FaxNo;
                        uoTextBoxVendorID.Text      = list[0].VendorIMS_ID;
                        BindAirportList(0);
                        BindPortAgentAirportList(0);
                        BindVendorTypeList(0);
                        BindVehicleTypeList(0);
                    }
                }
                else
                {
                    uoTextBoxCity.Text          = "";
                    uoTextBoxVendorName.Text    = "";
                    uoTextBoxVendorAddress.Text = "";
                    uoTextBoxWebsite.Text       = "";

                    uoTextBoxEmailTo.Text = "";
                    uoTextBoxEmailCc.Text = "";

                    vendorCountryLoad();
                    vendorCityLoad(0, uoDropDownListCountry.SelectedValue);
                    uoTextBoxContactNo.Text     = "";
                    uoTextBoxContactPerson.Text = "";
                    uoTextBoxFaxNo.Text         = "";
                    uoTextBoxVendorID.Text      = "";

                    uoListViewAirport.DataSource = null;
                    uoListViewAirport.DataBind();
                    BindAirportList(1);

                    BindVendorTypeList(1);
                    BindVehicleTypeList(1);
                }
            }
            else
            {
                uoTextBoxCity.Text          = "";
                uoTextBoxVendorName.Text    = "";
                uoTextBoxVendorAddress.Text = "";
                uoTextBoxWebsite.Text       = "";

                uoTextBoxEmailTo.Text = "";
                uoTextBoxEmailCc.Text = "";

                vendorCountryLoad();
                vendorCityLoad(0, uoDropDownListCountry.SelectedValue);
                uoTextBoxContactNo.Text     = "";
                uoTextBoxContactPerson.Text = "";
                uoTextBoxFaxNo.Text         = "";
                uoTextBoxVendorID.Text      = "";

                uoListViewAirport.DataSource = null;
                uoListViewAirport.DataBind();
                BindAirportList(1);

                BindVendorTypeList(1);
                BindVehicleTypeList(1);
            }
        }