private void BindCategory() { ddlCategory.Items.Clear(); try { DataTable dtCategory = new DataTable(); dtCategory = commonLookupBo.GetCategoryList("MF", null); if (dtCategory.Rows.Count > 0) { ddlCategory.DataSource = dtCategory; ddlCategory.DataValueField = dtCategory.Columns["PAIC_AssetInstrumentCategoryCode"].ToString(); ddlCategory.DataTextField = dtCategory.Columns["PAIC_AssetInstrumentCategoryName"].ToString(); ddlCategory.DataBind(); } //ddlCategory.Items.Insert(0, new ListItem("--SELECT--")); ddlCategory.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--SELECT--", "0")); ddlCategory.Items.Insert(1, new ListItem("All")); ddlCategory.SelectedIndex = 0; } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "MFManualSingleTran.ascx:BindBranchDropDown()"); object[] objects = new object[3]; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
//<summary> //Gets the list of Product Category //</summary> //<param name="LookupRequest"> The personal settings request. </param> //<returns> ProductAmcLookupResponse </returns> ProductCategoryLookupResponse IWerpCommonLookupContract.GetProductCategoryList(ProductCategoryLookupRequest LookupRequest) { ProductCategoryLookupResponse response = new ProductCategoryLookupResponse(); try { DataTable dt; string ProductCode = string.IsNullOrEmpty(LookupRequest.ProductCode) ? null : LookupRequest.ProductCode.Trim(); string CategoryCode = string.IsNullOrEmpty(LookupRequest.CategoryCode) ? null : LookupRequest.CategoryCode.Trim(); dt = BoCommonLookup.GetCategoryList(ProductCode, CategoryCode); foreach (DataRow row in dt.Rows) { response.ProductCategoryList.ProductCategoryList.Add(new KeyValuePair <string, string>(row["PAIC_AssetInstrumentCategoryCode"].ToString(), row["PAIC_AssetInstrumentCategoryName"].ToString())); } response.SetServiceResult(true, WerpErrorDto.E_SUCCESS, null); } catch (FormatException ex) { response.SetServiceResult(false, WerpErrorDto.E_INVALID_INPUT, ex.Message); } catch (DataException ex) { response.SetServiceResult(false, WerpErrorDto.E_DATABASE, ex.Message); } catch (Exception ex) { response.SetServiceResult(false, WerpErrorDto.E_GENERIC, ex.Message); } finally { } return(response); }