protected void DDLProductGroup_SelectedIndexChanged(object sender, EventArgs e) { string strQuery = @"Select distinct P.PRODUCT_SUBCATEGORY as Name,P.PRODUCT_SUBCATEGORY as Code from ax.InventTable P " + "where P.PRODUCT_GROUP='" + DDLProductGroup.SelectedItem.Value + "'"; DDLProdSubCategory.Items.Clear(); DDLProdSubCategory.Items.Add("Select..."); baseObj.BindToDropDown(DDLProdSubCategory, strQuery, "Name", "Code"); DDLProdSubCategory.Focus(); strQuery = "SELECT distinct inv.ITEMID+'-'+inv.Product_Name as Name,inv.ITEMID from ax.INVENTTABLE inv where inv.Product_Group='" + DDLProductGroup.SelectedValue + "' "; DDLProductDesc.DataSource = null; DDLProductDesc.Items.Clear(); DDLProductDesc.Items.Add("-Select-"); baseObj.BindToDropDown(DDLProductDesc, strQuery, "Name", "ITEMID"); }
private bool ValidateLineItemAdd() // Add Items Validation Logic // { bool b = false; LblProductMessage.Text = string.Empty; if (DDLWarehouseFrom.Text == "-Select-") { this.LblMessage.Text = "► Please Select the Warehouse From Location First !"; DDLWarehouseFrom.Focus(); b = false; return(b); } if (DDLWarehouseTo.Text == "-Select-") { this.LblMessage.Text = "► Please Select the Warehouse To Location First !"; DDLWarehouseFrom.Focus(); b = false; return(b); } if (DDLWarehouseTo.Text.ToString().Trim() == DDLWarehouseFrom.Text.ToString().Trim()) { this.LblMessage.Text = "► Please Warehouse From and Warehouse To Location different!"; DDLWarehouseTo.Focus(); b = false; return(b); } if (DDLProductGroup.Text == string.Empty) { this.LblMessage.Text = "► Product Group Not Available." + Environment.NewLine + " First Type Product Code to Get Details for Product Group !"; txtProductCode.Focus(); b = false; return(b); } if (DDLProdSubCategory.Text == string.Empty) { this.LblMessage.Text = "► Product Sub Category Group Not Available For This Item !"; DDLProdSubCategory.Focus(); b = false; return(b); } if (DDLProductDesc.Text == string.Empty) { this.LblMessage.Text = "► Product Description Not Available For This Item !"; DDLProductDesc.Focus(); b = false; return(b); } if (DDLReason.Text == "-Select-") { this.LblMessage.Text = "► Select Reason Type !"; DDLReason.Focus(); b = false; return(b); } if (txtStockMoveQty.Text == string.Empty) { this.LblMessage.Text = "► Please Provide Stock Moving Quantity Value !"; txtStockMoveQty.Focus(); b = false; return(b); } if (txtStockMoveQty.Text.Length > 0 && txtStockMoveQty.Text != string.Empty) { if (Convert.ToDecimal(txtStockMoveQty.Text) == 0) { this.LblMessage.Text = "► Stock Moving Quantity Value should be greater than zero (0)!"; txtStockMoveQty.Focus(); b = false; return(b); } else { LblMessage.Text = string.Empty; b = true; return(b); } } return(b); }