/// <summary> /// Date Created: 14/Aug/2013 /// Created By: Josephine Gad /// (description) Bind Vehicle Type Capacity in ListView /// </summary> private void BindServiceTypeDurationListView(int iContractID, Int16 iLoadType) { List <ContractServiceTypeDuration> listServiceTypeDuration = new List <ContractServiceTypeDuration>(); if (iLoadType == 0) { if (Session["ContractSafeguardTypeDuration"] != null) { listServiceTypeDuration = (List <ContractServiceTypeDuration>)Session["ContractSafeguardTypeDuration"]; } } else { SafeguardBLL.ServiceTypeGet(iContractID, GlobalCode.Field2Int(uoHiddenFieldVendorId.Value), true, 1); if (Session["ContractSafeguardTypeDuration"] != null) { listServiceTypeDuration = (List <ContractServiceTypeDuration>)Session["ContractSafeguardTypeDuration"]; } } uoListViewServiceTypeDuration.DataSource = listServiceTypeDuration; uoListViewServiceTypeDuration.DataBind(); }
/// Date Created: 12/Aug/2013 /// Created By: Josephine Gad /// (description) Bind Airport and Seaport private void BindServiceType(int iContractID, Int16 iLoadType) { List <ServiceType> listServiceType = new List <ServiceType>(); //List<ContractSafeguardTypeDuration> listVehicleTypeCapacity = new List<ContractSafeguardTypeDuration>(); if (iLoadType == 0) { SafeguardBLL.ServiceTypeGet(iContractID, GlobalCode.Field2Int(uoHiddenFieldVendorId.Value), false, 0); } BindSafeguardTypeDropDown(0, iLoadType); BindServiceTypeDurationListView(0, iLoadType); }
/// <summary> /// Date Created: 14/Aug/2013 /// Created By: Josephine Gad /// (description) Bind Vehicle Type Capacity in ListView /// </summary> private void BindSafeguardTypeDropDown(int iContractID, Int16 iLoadType) { List <ServiceType> listServiceType = new List <ServiceType>(); //List<ContractServiceTypeDuration> listServiceTypeDuration = new List<ContractServiceTypeDuration>(); //if (Session["ContractSafeguardTypeDuration"] != null) //{ // listServiceTypeDuration = (List<ContractServiceTypeDuration>)Session["ContractSafeguardTypeDuration"]; //} if (iLoadType == 0) { if (Session["ServiceType"] != null) { listServiceType = (List <ServiceType>)Session["ServiceType"]; } } else { SafeguardBLL.ServiceTypeGet(iContractID, GlobalCode.Field2Int(uoHiddenFieldVendorId.Value), false, 1); if (Session["ServiceType"] != null) { listServiceType = (List <ServiceType>)Session["ServiceType"]; } } //listServiceType.RemoveAll(a => listServiceType.Exists(b => a.ServiceTypeName == listServiceTypeDuration[])); //if (listServiceType.Count > 0) //{ // for (int i = 0; i < listServiceTypeDuration.Count; i++) // { // listServiceTypeDuration.RemoveAll(a => listServiceTypeDuration.Exists(b => a.ServiceType == listServiceType[i].ServiceTypeName)); // } //} listServiceType = listServiceType.OrderBy(a => a.ServiceTypeName).ToList(); uoDropDownListServiceType.Items.Clear(); uoDropDownListServiceType.DataSource = listServiceType; uoDropDownListServiceType.DataTextField = "ServiceTypeName"; uoDropDownListServiceType.DataValueField = "ServiceTypeID"; uoDropDownListServiceType.DataBind(); uoDropDownListServiceType.Items.Insert(0, new ListItem("--Select Service Type--", "0")); }