Example #1
0
        /// <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")
            {
                SafeguardBLL.SafeguardVendorsGetByID(GlobalCode.Field2Int(uoHiddenFieldSafeguardVendorIdInt.Value), iLoadType);
                List <VendorSafeguardDetails> listSafeguardDetails = new List <VendorSafeguardDetails>();

                if (Session["SafeguardVendorDetails"] != null)
                {
                    listSafeguardDetails = (List <VendorSafeguardDetails>)Session["SafeguardVendorDetails"];
                    if (listSafeguardDetails.Count > 0)
                    {
                        uoTextBoxCity.Text          = GlobalCode.Field2String(Session["SafeguardVendorCityFilter"]);
                        uoTextBoxVendorName.Text    = listSafeguardDetails[0].VendorName;
                        uoTextBoxVendorAddress.Text = listSafeguardDetails[0].Address;
                        uoTextBoxWebsite.Text       = listSafeguardDetails[0].Website;

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

                        vendorCountryLoad();
                        if (uoDropDownListCountry.Items.FindByValue(GlobalCode.Field2String(listSafeguardDetails[0].CountryID)) != null)
                        {
                            uoDropDownListCountry.SelectedValue = GlobalCode.Field2String(listSafeguardDetails[0].CountryID);
                        }
                        vendorCityLoad(0, uoDropDownListCountry.SelectedValue);
                        if (uoDropDownListCity.Items.FindByValue(GlobalCode.Field2String(listSafeguardDetails[0].CityID)) != null)
                        {
                            uoDropDownListCity.SelectedValue = GlobalCode.Field2String(listSafeguardDetails[0].CityID);
                        }
                        uoTextBoxContactNo.Text     = listSafeguardDetails[0].ContactNo;
                        uoTextBoxContactPerson.Text = listSafeguardDetails[0].ContactPerson;
                        uoTextBoxFaxNo.Text         = listSafeguardDetails[0].FaxNo;
                        //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         = "";

                    //uoListViewVehicleType.DataSource = null;
                    //uoListViewVehicleType.DataBind();
                    //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         = "";
                //uoListViewVehicleType.DataSource = null;
                //uoListViewVehicleType.DataBind();
                //BindVehicleTypeList(1);
            }
        }
        /// Date Modified:  12/Aug/2013
        /// Modified By:    Josephine Gad
        /// (description)   Bind all details in 1 function
        ///                 use list instead of DataTable
        ///
        ///
        /// </summary>
        private void BindSafeguardBranch(int iContractID)
        {
            //DataTable dt = new DataTable();
            try
            {
                if (iContractID == 0)
                {
                    SafeguardBLL.SafeguardVendorsGetByID(GlobalCode.Field2Int(Request.QueryString["vmId"]), 0);
                    List <VendorSafeguardDetails> listVehicleDetails = new List <VendorSafeguardDetails>();

                    if (Session["SafeguardVendorDetails"] != null)
                    {
                        listVehicleDetails = (List <VendorSafeguardDetails>)Session["SafeguardVendorDetails"];
                        if (listVehicleDetails.Count > 0)
                        {
                            uoTextBoxContractTitle.Text = listVehicleDetails[0].VendorName + " Contract";
                            //uoTextBoxVendorBranch.Text = listVehicleDetails[0].VendorName;

                            //uoTextBoxCountry.Text = listVehicleDetails[0].VendorSafeguardDetails;
                            //uoTextBoxCity.Text = listVehicleDetails[0].CityName;
                        }
                    }
                }
                else
                {
                    List <ContractSafeguardDetails> list = new List <ContractSafeguardDetails>();
                    list = (List <ContractSafeguardDetails>)Session["SafeguardVendorDetails"];
                    if (list.Count > 0)
                    {
                        uoTextBoxContractTitle.Text = list[0].ContractName;
                        //uoTextBoxVendorBranch.Text = list[0].VehicleName;

                        //uoTextBoxCountry.Text = list[0].CountryName;
                        //uoTextBoxCity.Text = list[0].CityName;

                        uoTextBoxRemarks.Text = list[0].Remarks;

                        if (list[0].ContractDateStart != null)
                        {
                            uoTextBoxContractStartDate.Text = list[0].ContractDateStart;
                        }
                        if (list[0].ContractDateEnd != null)
                        {
                            uoTextBoxContractEndDate.Text = list[0].ContractDateEnd;
                        }
                        if (list[0].RCCLAcceptedDate != null)
                        {
                            uoTextBoxRCCLDateAccepted.Text = list[0].RCCLAcceptedDate;
                        }
                        if (list[0].VendorAcceptedDate != null)
                        {
                            uoTextBoxVendorDateAccepted.Text = list[0].VendorAcceptedDate;
                        }

                        uotextboxRCCLRep.Text   = list[0].RCCLPersonnel;
                        uotextboxVendorRep.Text = list[0].VendorPersonnel;
                        uoDropDownListCurrency.SelectedValue = GlobalCode.Field2String(list[0].CurrencyID);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }