Пример #1
0
        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);
        }
Пример #2
0
        public void FillProductCode()
        {
            string strQuery = string.Empty;

            if (DDLBusinessUnit.SelectedItem.Text == "All...")
            {
                DDLProductDesc.Items.Clear();
                // DDLMaterialCode.Items.Add("Select...");
                if (DDLProductGroup.Text == "Select..." && DDLProdSubCategory.Text == "Select..." || DDLProdSubCategory.Text == "")
                {
                    strQuery = "SELECT DISTINCT(ITEMID) as Product_Code,concat([ITEMID],' - ',PRODUCT_NAME) as Product_Name from ax.INVENTTABLE inv WHERE  INV.block=0 and BU_CODE in (select bm.bu_code from ax.acxsitebumapping sbp join ax.ACXBUMASTER bm on bm.bu_code = sbp.BU_CODE where SITEID = '" + Convert.ToString(Session["SiteCode"]) + "')";
                    //if (rdStock.Checked == true)
                    //{
                    //    strQuery += " AND inv.ITEMID IN (SELECT DISTINCT ProductCode FROM AX.ACXINVENTTRANS TT WHERE SITECODE='" + Session["SiteCode"].ToString() + "' AND TransLocation IN (SELECT i.MAINWAREHOUSE FROM ax.INVENTSITE i WHERE i.SITEID=TT.SiteCode) GROUP BY ProductCode HAVING SUM(TransQty)>0)";
                    //}
                    strQuery += "  order by Product_Name";
                    DDLProductDesc.Items.Clear();
                    DDLProductDesc.Items.Add("Select...");
                    //DataTable dt = baseObj.GetData(strQuery);

                    baseObj.BindToDropDown(DDLProductDesc, strQuery, "Product_Name", "Product_Code");
                    DDLProductDesc.Focus();
                }
            }
            else
            {
                DDLProductDesc.Items.Clear();
                // DDLMaterialCode.Items.Add("Select...");
                if (DDLProductGroup.Text == "Select..." && DDLProdSubCategory.Text == "Select..." || DDLProdSubCategory.Text == "")
                {
                    strQuery = "SELECT DISTINCT(ITEMID) as Product_Code,concat([ITEMID],' - ',PRODUCT_NAME) as Product_Name from ax.INVENTTABLE inv WHERE  INV.block=0"
                               + " and BU_CODE in('" + DDLBusinessUnit.SelectedItem.Value.ToString() + "')";
                    //if (rdStock.Checked == true)
                    //{
                    //    strQuery += " AND inv.ITEMID IN (SELECT DISTINCT ProductCode FROM AX.ACXINVENTTRANS TT WHERE SITECODE='" + Session["SiteCode"].ToString() + "' AND TransLocation IN (SELECT i.MAINWAREHOUSE FROM ax.INVENTSITE i WHERE i.SITEID=TT.SiteCode) GROUP BY ProductCode HAVING SUM(TransQty)>0)";
                    //}
                    strQuery += " order by Product_Name";
                    DDLProductDesc.Items.Clear();
                    DDLProductDesc.Items.Add("Select...");
                    //DataTable dt = baseObj.GetData(strQuery);

                    baseObj.BindToDropDown(DDLProductDesc, strQuery, "Product_Name", "Product_Code");
                    DDLProductDesc.Focus();
                }
            }
            //DDLProductDesc.Items.Clear();
            //// DDLMaterialCode.Items.Add("Select...");
            //string BU;
            //if (DDLBusinessUnit.SelectedIndex == 0)
            //{
            //    BU = "";
            //}
            //else
            //{
            //    BU = DDLBusinessUnit.SelectedValue.ToString();
            //}
            //
            //if (DDLProductGroup.Text == "Select..." && DDLProdSubCategory.Text == "Select..." || DDLProdSubCategory.Text == "")
            //{
            //    string strQuery = "select distinct(ItemId) as Product_Code,concat([ITEMID],' - ',Product_Name) as Product_Name from ax.INVENTTABLE";
            //    strQuery += " where BU_CODE LIKE CASE WHEN LEN('"+ BU +"')>0 THEN '"+ BU +"' ELSE '%' END order by Product_Name";
            //    DDLProductDesc.Items.Clear();
            //    DDLProductDesc.Items.Add("Select...");
            //    baseObj.BindToDropDown(DDLProductDesc, strQuery, "Product_Name", "Product_Code");
            //    DDLProductDesc.Focus();
            //}
        }