Ejemplo n.º 1
0
        private ChakraResult CollectResults(string sAddedName)
        {
            ChakraResult tmpRes = new ChakraResult("", "", "", "", "", "", "", 0, 0, 0, 0, "", "", 0, 0, 0);

            tmpRes.mAddedName         = sAddedName;
            tmpRes.mNameSum           = cntrlCls.Find("txtPName_Num", true)[0].Text;
            tmpRes.mChakraSexCreation = cntrlCls.Find("txtNum6", true)[0].Text;
            tmpRes.mCharkraThrought   = cntrlCls.Find("txtNum3", true)[0].Text;
            tmpRes.mCharkraBase       = cntrlCls.Find("txtNum7", true)[0].Text;
            tmpRes.mCharkraThirdEye   = cntrlCls.Find("txtNum2", true)[0].Text;
            tmpRes.mCharkraHeart      = cntrlCls.Find("txtNum4", true)[0].Text;

            tmpRes.mBussiness     = Convert.ToDouble(cntrlCls.Find("txtFinalBusinessMark", true)[0].Text);
            tmpRes.mLrnSccss      = Convert.ToDouble(cntrlCls.Find("txtLeanSccss", true)[0].Text);
            tmpRes.mCharkraHealth = Convert.ToDouble(cntrlCls.Find("txtHealthValue", true)[0].Text);

            DataGridView    tmpDgv = cntrlCls.Find("dgvCombMapSum", true)[0] as DataGridView;
            DataGridViewRow r      = tmpDgv.Rows[0];

            tmpRes.mPhysical = Convert.ToInt16(r.Cells[r.Cells.Count - 1].Value.ToString());
            r = tmpDgv.Rows[1];
            tmpRes.mEmotional = Convert.ToInt16(r.Cells[r.Cells.Count - 1].Value.ToString());
            r = tmpDgv.Rows[2];
            tmpRes.mMental = Convert.ToInt16(r.Cells[r.Cells.Count - 1].Value.ToString());
            r = tmpDgv.Rows[3];
            tmpRes.mEnergetic = Convert.ToInt16(r.Cells[r.Cells.Count - 1].Value.ToString());

            string[] s = cntrlCls.Find("txtInfo1", true)[0].Text.Split(System.Environment.NewLine.ToCharArray()[0]);//" ".ToCharArray()[0]);
            tmpRes.mMapBalance   = s[1];
            tmpRes.mMapDepration = cntrlCls.Find("txtDepMap", true)[0].Text;

            return(tmpRes);
        }
Ejemplo n.º 2
0
        private bool isFilterPassed(ChakraResult res)
        {
            if (rbtnNonFilter.Checked)
            {
                return(true);
            }

            bool outRes = true, tmpRes = false;

            #region Filter_Form
            //int num;
            string[] sNums;
            string[] Nums2Test;
            string   dlmtr = ", /";

            if (cbCon.Checked == true)
            {
                //num = mCalc.GetCorrectNumberFromSplitedString(cntrlCls.Find("txtNum7",true)[0].Text.Split(mCalc.Delimiter));
                //outRes &= (num.ToString() == txtCon.Text);
                tmpRes    = false;
                sNums     = cntrlCls.Find("txtNum7", true)[0].Text.Split(mCalc.Delimiter);
                Nums2Test = txtCon.Text.Trim().Split(dlmtr.ToCharArray());
                for (int k = 0; k < Nums2Test.Length; k++)
                {
                    tmpRes |= mCalc.isNumInArray(sNums, Convert.ToInt16(Nums2Test[k]));
                }
                outRes &= tmpRes;
            }

            //if (cbVol.Checked == true)
            //{
            //    num = mCalc.GetCorrectNumberFromSplitedString(cntrlCls.Find("txtNum3", true)[0].Text.Split(mCalc.Delimiter));
            //    outRes &= (num.ToString() == txtVol.Text);
            //}

            if (cbSex.Checked == true || (groupBox7.Visible && rbtnFilterAdvanced.Checked))
            {
                //num = mCalc.GetCorrectNumberFromSplitedString(cntrlCls.Find("txtNum6", true)[0].Text.Split(mCalc.Delimiter));
                //outRes &= (num.ToString() == txtSex.Text);
                tmpRes    = false;
                sNums     = cntrlCls.Find("txtNum6", true)[0].Text.Split(mCalc.Delimiter);
                Nums2Test = txtSex.Text.Trim().Split(dlmtr.ToCharArray());
                if (groupBox7.Visible && rbtnFilterAdvanced.Checked)
                {
                    //if independed
                    if (cbIndepended.Checked || cbIndependedFuture.Checked) //!cbEmployee
                    {
                        if (round == 0 || round == 1)
                        {
                            Nums2Test = firstSex;// new string[] { "1", "3", "5", "8" };
                        }
                        if (round == 2)
                        {
                            Nums2Test = secoundSex;
                        }
                    }
                    else
                    {
                        //is employee
                        if (round == 0 || round == 1 || round == 2)
                        {
                            Nums2Test = firstSex;// new string[] { "1", "3", "5", "8" };
                        }
                        if (round == 3)
                        {
                            Nums2Test = secoundSex;
                        }
                    }
                }
                for (int k = 0; k < Nums2Test.Length; k++)
                {
                    tmpRes |= mCalc.isNumInArray(sNums, Convert.ToInt16(Nums2Test[k]));
                }
                outRes &= tmpRes;
            }

            if (cbThrought.Checked == true || (groupBox7.Visible && rbtnFilterAdvanced.Checked))
            {
                //num = mCalc.GetCorrectNumberFromSplitedString(cntrlCls.Find("txtNum3", true)[0].Text.Split(mCalc.Delimiter));
                //outRes &= (num.ToString() == txtThr.Text);
                tmpRes    = false;
                sNums     = cntrlCls.Find("txtNum3", true)[0].Text.Split(mCalc.Delimiter);
                Nums2Test = txtThr.Text.Trim().Split(dlmtr.ToCharArray());
                if (groupBox7.Visible && rbtnFilterAdvanced.Checked)
                {
                    //if independed
                    if (cbIndepended.Checked || cbIndependedFuture.Checked)
                    {
                        if (round == 0 || round == 2)
                        {
                            Nums2Test = firstThrought;// new string[] { "1", "8", "9" };
                        }
                        if (round == 1)
                        {
                            Nums2Test = secoundThrought;
                        }
                    }
                    else
                    {
                        //is employee
                        if (round == 0)
                        {
                            Nums2Test = employeeFirstThrought;// new string[] { "1", "8", "9" };
                        }
                        if (round == 1)
                        {
                            Nums2Test = employeeSecoundThrought;
                        }
                        if (round == 2)
                        {
                            Nums2Test = employeeThirdThrought;
                        }
                        if (round == 3)
                        {
                            Nums2Test = employeeQuarterThrought;
                        }
                    }
                }
                for (int k = 0; k < Nums2Test.Length; k++)
                {
                    tmpRes |= mCalc.isNumInArray(sNums, Convert.ToInt16(Nums2Test[k]));
                }
                outRes &= tmpRes;
            }

            if (cbAddedNameSum.Checked == true)
            {
                //num = mCalc.GetCorrectNumberFromSplitedString(cntrlCls.Find("txtPName_Num", true)[0].Text.Split(mCalc.Delimiter));
                //outRes &= (num.ToString() == txtAddedNameSum.Text);
                tmpRes    = false;
                sNums     = cntrlCls.Find("txtPName_Num", true)[0].Text.Split(mCalc.Delimiter);
                Nums2Test = txtAddedNameSum.Text.Trim().Split(dlmtr.ToCharArray());
                for (int k = 0; k < Nums2Test.Length; k++)
                {
                    tmpRes |= mCalc.isNumInArray(sNums, Convert.ToInt16(Nums2Test[k]));
                }
                outRes &= tmpRes;
            }

            if (cbThirdEyeNoSeven.Checked == true)
            {
                outRes &= (mCalc.GetCorrectNumberFromSplitedString(res.mCharkraThirdEye.Split(mCalc.Delimiter)) != 7);
            }
            if (cbHeartNoZero.Checked == true)
            {
                outRes &= (mCalc.GetCorrectNumberFromSplitedString(res.mCharkraHeart.Split(mCalc.Delimiter)) != 0);
            }
            #endregion

            #region Filter_res - carmatic
            string tmp;
            tmp     = res.mNameSum;
            outRes &= !(mCalc.isCarmaticNumber(mCalc.GetCorrectNumberFromSplitedString(tmp.Split(mCalc.Delimiter))));

            tmp = res.mChakraSexCreation;
            if (cbVol2.Checked == false)
            {
                outRes &= !(mCalc.isCarmaticNumber(mCalc.GetCorrectNumberFromSplitedString(tmp.Split(mCalc.Delimiter))));
            }

            tmp     = res.mCharkraThrought;
            outRes &= !(mCalc.isCarmaticNumber(mCalc.GetCorrectNumberFromSplitedString(tmp.Split(mCalc.Delimiter))));

            tmp     = res.mCharkraBase;
            outRes &= !(mCalc.isCarmaticNumber(mCalc.GetCorrectNumberFromSplitedString(tmp.Split(mCalc.Delimiter))));

            tmp = res.mCharkraThirdEye;
            if (cbVol.Checked == false)
            {
                outRes &= !(mCalc.isCarmaticNumber(mCalc.GetCorrectNumberFromSplitedString(tmp.Split(mCalc.Delimiter))));
            }

            tmp     = res.mCharkraHeart;
            outRes &= !(mCalc.isCarmaticNumber(mCalc.GetCorrectNumberFromSplitedString(tmp.Split(mCalc.Delimiter))));
            #endregion



            return(outRes);
        }
Ejemplo n.º 3
0
        private async Task BalanceNamesAsync(List <string> namesList)
        {
            await Task.Factory.StartNew(() =>
            {
                foreach (string CurAddedName in namesList)//(int index = 0; index < NamesList.Length; index++)
                {
                    UserInfo CurUser = new UserInfo();

                    //gcCounter = gcCounter + 1;

                    string finalCurAddedName = CurAddedName.Trim();

                    if (finalCurAddedName.Contains("'"))
                    {
                        finalCurAddedName = finalCurAddedName.Replace("'", "");
                    }

                    if (finalCurAddedName.Contains("-"))
                    {
                        finalCurAddedName = finalCurAddedName.Replace("-", "");
                    }

                    finalCurAddedName = mCalc.ChangeFinalChars(finalCurAddedName);

                    if (rbtnFamily.Checked == false)        // Private Names Testings
                    {
                        if (cbAddOrReplace.Checked == true) // add a first name
                        {
                            string fName       = OriginalUser.mFirstName;
                            CurUser.mFirstName = fName + finalCurAddedName;
                        }
                        else// replace a first name
                        {
                            CurUser.mFirstName = finalCurAddedName;
                        }
                    }
                    else // Last Names Testings
                    {
                        string fName = OriginalUser.mFirstName;

                        if (cbAddOrReplace.Checked == true) // add a family name
                        {
                            CurUser.mLastName = fName + finalCurAddedName;
                        }
                        else// replace family name
                        {
                            CurUser.mLastName = finalCurAddedName;
                        }
                    }

                    //UpdateMainForm(CurUser);
                    CurUser.ApplyUserInfo2ProgData(mParentForm);

                    //RunProgram();

                    ChakraResult curRes = CollectResults(CurAddedName);
                    if (isFilterPassed(curRes))
                    {
                        chkrResList.Add(curRes);
                    }

                    //if (gcCounter > 5)
                    //{
                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                    GC.WaitForFullGCComplete();

                    //gcCounter = 0;
                    //}
                }
            });
        }
Ejemplo n.º 4
0
        private async void btnCalc_Click(object sender, EventArgs e)
        {
            if (groupBox7.Visible && !cbIndepended.Checked && !cbIndependedFuture.Checked && !cbEmployee.Checked)
            {
                string s1 = "", s2 = "";
                if (BLL.AppSettings.Instance.ProgramLanguage == AppSettings.Language.Hebrew)
                {
                    s1 = "חובה לסמן את 1 או יותר משלושת השדות הראשונים";
                    s2 = "נתונים חסרים : ";
                }
                if (BLL.AppSettings.Instance.ProgramLanguage == AppSettings.Language.English)
                {
                    s1 = "You must mark 1 or more of the first three fields";
                    s2 = "Missing data...";
                }
                MessageBox.Show(s2 + System.Environment.NewLine + s1, "טעות הכנסת נתונים", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                OriginalUser = new UserInfo();

                bool repres = OriginalUser.ProgData2UserInfo(mParentForm);

                chkrResList.Clear();

                UserInfo CurUser = new UserInfo();

                #region Duplicate

                CurUser = OriginalUser;

                #endregion Duplicate

                string fName = OriginalUser.mFirstName;
                string lName = OriginalUser.mLastName;

                #region GetNames

                string sFilePath = mParentForm.AppMainDir + "\\Names";
                if (AppSettings.Instance.ProgramLanguage == AppSettings.Language.Hebrew)
                {
                    if (rbtnFamily.Checked == true)
                    {
                        sFilePath += "\\Heb_JusidhLastNames";
                    }
                    else
                    {
                        if (rbtnJuish.Checked == true)
                        {
                            sFilePath += "\\Juish";
                        }
                        if (rbtnJuishBible.Checked == true)
                        {
                            sFilePath += "\\JuishBible";
                        }
                        if (rbtnArab.Checked == true)
                        {
                            sFilePath += "\\Arab";
                        }
                        if (rbtnMale.Checked == true)
                        {
                            sFilePath += "Male";
                        }
                        else
                        {
                            sFilePath += "Female";
                        }
                    }
                }

                if (AppSettings.Instance.ProgramLanguage == AppSettings.Language.English)
                {
                    // only male / female / family
                    sFilePath += "\\Eng_";
                    if (rbtnMale.Checked == true)
                    {
                        sFilePath += "MaleNames";
                    }
                    if (rbtnFemale.Checked == true)
                    {
                        sFilePath += "FemaleNames";
                    }
                    if (rbtnFamily.Checked == true)
                    {
                        sFilePath += "LastNames";
                    }
                }

                sFilePath += ".txt";

                #endregion

                List <string> NamesList = ReadNamesFile(sFilePath);

                //MessageBox.Show($"Not Implemented Yet !", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                //return;

                // await BalanceNamesAsync(NamesList);

                //int iii = 0;
                foreach (string CurAddedName in NamesList)//(int index = 0; index < NamesList.Length; index++)
                {
                    //gcCounter = gcCounter + 1;

                    string finalCurAddedName = CurAddedName.Trim();

                    if (finalCurAddedName.Contains("'"))
                    {
                        finalCurAddedName = finalCurAddedName.Replace("'", "");
                    }

                    if (finalCurAddedName.Contains("-"))
                    {
                        finalCurAddedName = finalCurAddedName.Replace("-", "");
                    }

                    finalCurAddedName = mCalc.ChangeFinalChars(finalCurAddedName);

                    if (rbtnFamily.Checked == false)        // Private Names Testings
                    {
                        if (cbAddOrReplace.Checked == true) // add a first name
                        {
                            CurUser.mFirstName = fName + finalCurAddedName;
                        }
                        else// replace a first name
                        {
                            CurUser.mFirstName = finalCurAddedName;
                        }
                    }
                    else // Last Names Testings
                    {
                        if (cbAddOrReplace.Checked == true) // add a family name
                        {
                            CurUser.mLastName = lName + finalCurAddedName;
                        }
                        else// replace family name
                        {
                            CurUser.mLastName = finalCurAddedName;
                        }
                    }

                    //UpdateMainForm(CurUser);
                    CurUser.ApplyUserInfo2ProgData(mParentForm);

                    RunProgram();

                    ChakraResult curRes = CollectResults(CurAddedName);
                    if (isFilterPassed(curRes))
                    {
                        chkrResList.Add(curRes);
                    }

                    //if (gcCounter > 5)
                    //{
                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                    GC.WaitForFullGCComplete();

                    //gcCounter = 0;
                    //}
                }

                dgvRes.Rows.Clear();
                dgvRes.Update();
                UpdateDataGrid();

                #region Restore Initial Value
                mParentForm.ClearForm();

                //UpdateMainForm(OriginalUser);
                OriginalUser.mFirstName = fName;
                OriginalUser.mLastName  = lName;
                repres = OriginalUser.ApplyUserInfo2ProgData(mParentForm);

                //OriginalUser.mFirstName = fName;
                //OriginalUser.ApplyUserInfo2ProgData(mParentForm);
                RunProgram();
                #endregion

                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.WaitForFullGCComplete();

                if (groupBox7.Visible && rbtnFilterAdvanced.Checked)
                {
                    if (chkrResList.Count == 0 && round <= getNumberOfRound())
                    {
                        round++;
                        btnCalc.PerformClick();
                        //return;
                    }
                    else
                    {
                        MessageBox.Show("אם יש צורך צור קשר עם יעקובי", "הודעה", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }