protected void ddlItemsSubCategory_Rqd_SelectedIndexChanged(object sender, EventArgs e) { this.ddlItems_Rqd.Items.Clear(); this.ddlItems_Rqd.DataSource = ""; this.ddlItems_Rqd.DataBind(); if (this.ddlItemsSubCategory_Rqd.SelectedIndex > 0) { try { this.ddlItems_Rqd.Items.Add("छान्नुहोस"); ATTInvOrgItemsPrice obj = new ATTInvOrgItemsPrice(); obj.OrgID = ((ATTUserLogin)Session["Login_User_Detail"]).OrgID; obj.ItemsCategoryID = int.Parse(this.ddlItemsCategory_Rqd.SelectedValue); obj.ItemsSubCategoryID = int.Parse(this.ddlItemsSubCategory_Rqd.SelectedValue); obj.ItemsTypeID = 1; obj.Quantity = 0; List <ATTInvOrgItemsPrice> lstItems = BLLInvOrgItemsPrice.GetOrgInvItemsPrice(obj); Session["ItemsList"] = lstItems; this.ddlItems_Rqd.DataSource = lstItems; this.ddlItems_Rqd.DataTextField = "ITEMNAME"; this.ddlItems_Rqd.DataValueField = "ITEMSID"; this.ddlItems_Rqd.DataBind(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } } }
protected void ddlSubCategory_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlSubCategory_cat.SelectedIndex > 0) { Session["RptPoItems"] = BLLInvOrgItemsPrice.GetOrgInvItemsPrice(9, int.Parse(ddlCategory_cat.SelectedValue), int.Parse(ddlSubCategory_cat.SelectedValue)); ddlItems_cat.DataSource = (List <ATTInvOrgItemsPrice>)Session["RptPoItems"]; ddlItems_cat.DataTextField = "ItemName"; ddlItems_cat.DataValueField = "ItemsID"; ddlItems_cat.DataBind(); ListItem a = new ListItem(); a.Selected = true; a.Text = "----छान्नुहोस----"; a.Value = "0"; ddlItems_cat.Items.Insert(0, a); ddlItems_cat.Enabled = true; } else { ddlItems_cat.SelectedIndex = -1; ddlItems_cat.Enabled = false; } } catch (Exception ex) { throw (ex); } }
private void LoadDDLItems() { ATTInvOrgItemsPrice obj = new ATTInvOrgItemsPrice(); obj.OrgID = ((ATTUserLogin)Session["Login_User_Detail"]).OrgID; obj.ItemsCategoryID = int.Parse(ddlCategory.SelectedValue); obj.ItemsSubCategoryID = int.Parse(ddlSubCategory.SelectedValue); obj.Quantity = 0; Session["Items"] = BLLInvOrgItemsPrice.GetOrgInvItemsPrice(obj); ddlItemsKNJ.DataSource = (List <ATTInvOrgItemsPrice>)Session["Items"]; ddlItemsKNJ.DataTextField = "ItemNameWithQty"; ddlItemsKNJ.DataValueField = "ItemsID"; ddlItemsKNJ.DataBind(); ListItem a = new ListItem(); a.Selected = true; a.Text = "----छान्नुहोस----"; a.Value = "0"; ddlItemsKNJ.Items.Insert(0, a); ddlItemsKNJ.Enabled = true; }
protected void DDLItemsSubCategory_Rqd_SelectedIndexChanged(object sender, EventArgs e) { try { ClearControls(2); List <ATTInvOrgItemsPrice> lstItems = BLLInvOrgItemsPrice.GetOrgInvItemsPrice(9, int.Parse(this.DDLItemsCategory_Rqd.SelectedValue), int.Parse(this.DDLItemsSubCategory_Rqd.SelectedValue), true); this.DDLItems_Rqd.DataSource = lstItems; this.DDLItems_Rqd.DataTextField = "ITEMNAME"; this.DDLItems_Rqd.DataValueField = "ITEMSID"; this.DDLItems_Rqd.DataBind(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
protected void btnSearch_Click(object sender, EventArgs e) { try { if (ddlCategory.SelectedIndex < 1 && ddlSubCategory.SelectedIndex < 1) { lblStatusMessage.Text = "Select atleast one Search Criteria"; programmaticModalPopup.Show(); return; } int?catId = null; if (ddlCategory.SelectedIndex > 0) { catId = int.Parse(ddlCategory.SelectedValue); } int?subcatId = null; if (ddlSubCategory.SelectedIndex > 0) { subcatId = int.Parse(ddlSubCategory.SelectedValue); } List <ATTInvOrgItemsPrice> lst = BLLInvOrgItemsPrice.GetOrgInvItemsPrice(orgID, catId, subcatId, false); if (lst.Count > 0) { Session["ItemsPrice"] = lst; } else { Session["ItemsPrice"] = new List <ATTInvOrgItemsPrice>(); } grdInvOrgItemsPrice.DataSource = lst; grdInvOrgItemsPrice.DataBind(); } catch (Exception ex) { lblStatusMessage.Text = ex.Message; programmaticModalPopup.Show(); } }
protected void ddlSubCategory_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlSubCategory_cat.SelectedIndex > 0) { Session["PoItems"] = BLLInvOrgItemsPrice.GetOrgInvItemsPrice(9, int.Parse(ddlCategory_cat.SelectedValue), int.Parse(ddlSubCategory_cat.SelectedValue)); ddlItems_cat.DataSource = (List <ATTInvOrgItemsPrice>)Session["PoItems"]; ddlItems_cat.DataTextField = "ItemName"; ddlItems_cat.DataValueField = "ItemsID"; ddlItems_cat.DataBind(); ListItem a = new ListItem(); a.Selected = true; a.Text = "----छान्नुहोस----"; a.Value = "0"; ddlItems_cat.Items.Insert(0, a); ddlItems_cat.Enabled = true; } else { ddlItems_cat.SelectedIndex = -1; ddlItems_cat.Enabled = false; } txtQty_cat.Text = ""; } catch (Exception ex) { this.lblStatusMessageTitle.Text = "Error Status"; this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }