private bool getemptyValidation()
        {
            bool emptyval1 = true;
            bool emptyval2 = true;
            bool emptyval3 = true;
            bool emptyval4 = true;

            Validations val1 = new Validations();

            if (val1.emptyFieldVal(txtFOBPAddFabPricePerYard, lblFOBPFabErrPricePerYard))
                emptyval1 = false;

            if (val1.emptyFieldVal(txtFOBPAddFabYardage, lblFOBPFabErrYardage))
                emptyval2 = false;

            if (val1.emptyFieldVal(txtFOBPAddFabCourierTransport, lblFOBPFabErrCourierTransport))
                emptyval3 = false;

            if (val1.emptyFieldVal(cmbFOBPAddFabType, lblFOBPFabErrType))
                emptyval4 = false;

            //MessageBox.Show((emptyval1 && emptyval2 && emptyval3 && emptyval4).ToString() + "|" + emptyval1.ToString()+"|"+emptyval2.ToString()+"|"+emptyval3.ToString()+"|"+emptyval4.ToString());

            return emptyval1 || emptyval2 || emptyval3 || emptyval4;
        }
        private void btnAddAccList_Click(object sender, RoutedEventArgs e)
        {
            Validations val = new Validations();

            if ((val.emptyFieldVal(txtWeightPItem.Text) || val.emptyFieldVal(txtCostOfHgrams.Text)))
            {
                
                double wPI = Convert.ToDouble(txtWeightPItem.Text);
                double costForH = Convert.ToDouble(txtCostOfHgrams.Text);
                double amt = Convert.ToDouble(txtAccAmt.Text);

                addItems(lstBoxAccType, cmbAccTypes.SelectedValue.ToString());
                addItems(lstBoxAccWPI, txtWeightPItem.Text);
                addItems(lstBoxAccCostForH, txtCostOfHgrams.Text);
                addItems(lstBoxAccAmt, txtAccAmt.Text);
                addItems(lstBoxAccCostPI, ((costForH / 100.0) * wPI * amt).ToString("0.00"));
                addItems(lstBoxAccCostID, "XXXX");


                clear(cmbAccTypes, txtWeightPItem, txtCostOfHgrams, btnAddAccList, txtAccAmt);
            }
            else
            {
                MessageBox.Show("Weight per item and Cost of 100 grams can not be empty !", "Empty Fields in Accessories", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }

        }
        private bool getEmptyValForacc()
        {
            bool emptyvalacc1 = true;
            bool emptyvalacc2 = true;
            bool emptyvalacc3 = true;
            bool emptyvalacc4= true;
            bool emptyvalacc5 = true;
            Validations valAcc = new Validations();

            if (valAcc.emptyFieldVal(txtFOBPAddAccPricePerUnit, lblFOBPErrAccPricePreUnit))
            {
                emptyvalacc1 = false;
            }

            if (valAcc.emptyFieldVal(txtFOBPAddAccNoOfUnits, lblFOBPErrAccNoOfUnits))
            {
                emptyvalacc2 = false;
            }

            if (valAcc.emptyFieldVal(txtFOBPAddAccCourierTransport, lblFOBPErrAccCourierTransport))
            {
                  emptyvalacc3 = false;
            }
           
            if (valAcc.emptyFieldVal(cmbFOBPAddAccType, lblFOBPErrAccType))
            {
                emptyvalacc4 = false;
            }
            if (valAcc.emptyFieldVal(cmbFOBPAddAccUnit, lblFOBPErrAccUnit))
            {
                emptyvalacc5 = false;
            }



            return emptyvalacc1 || emptyvalacc2 || emptyvalacc3 || emptyvalacc4 || emptyvalacc5 ;
        }
        private void btnAddFabToList_Click(object sender, RoutedEventArgs e)
        {
            Validations val = new Validations();

            if ((val.emptyFieldVal(txtCostPYard.Text) || val.emptyFieldVal(txtConsump.Text)))
            {
                
                try
                {
                    double fabCPY = Convert.ToDouble(txtCostPYard.Text);
                    double fabComsup = Convert.ToDouble(txtConsump.Text);

                    addItems(lstBoxFabType, cmbFabTypes.SelectedValue.ToString());
                    addItems(lstBoxFabCPY, txtCostPYard.Text);
                    addItems(lstBoxFabComsup, txtConsump.Text);
                    addItems(lstBoxFabCost, (fabCPY * fabComsup).ToString("0.00"));
                    addItems(lstBoxFabCostID, "XXXX");


                    clear(cmbFabTypes, txtCostPYard, txtConsump, btnAddFabToList);
                }
                catch (Exception)
                {
                }

            }
            else
            {
                MessageBox.Show("Cost per Yard and Consumtion can not be empty !", "Empty Fields in Fabrics", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }
        }