Ejemplo n.º 1
0
        public static List <denomTranslation> cashInTotalsByCurrency(List <denomTranslation> cashInByCurrencyList)
        {
            List <denomTranslation> cashInTotalsByCurrencyList = new List <denomTranslation>();



            foreach (denomTranslation cashInByCurrencyElement in cashInByCurrencyList)
            {
                cashInByCurrencyElement.denomTotal = cashInByCurrencyElement.denomCount * cashInByCurrencyElement.denomValue;
            }



            var teamTotalScores =
                from player in cashInByCurrencyList
                group player by player.denomType into playerGroup
                select new
            {
                Team       = playerGroup.Key,
                TotalScore = playerGroup.Sum(x => x.denomTotal),
            };

            foreach (var totalScore in teamTotalScores)
            {
                denomTranslation cashInTotalsByCurrencyElement = new denomTranslation();
                cashInTotalsByCurrencyElement.denomType  = totalScore.Team;
                cashInTotalsByCurrencyElement.denomTotal = totalScore.TotalScore;
                cashInTotalsByCurrencyList.Add(cashInTotalsByCurrencyElement);
            }

            return(cashInTotalsByCurrencyList);
        }
Ejemplo n.º 2
0
        //currency kodu ile birlikte değerinin de gelmesi lazım
        public static denomTranslation returnCurrencyTypeValue(string noteId)
        {
            denomTranslation denomTranslate = returnNoteInfo(noteId);

            //string  currencyType = denomTranslate.denomType;
            //int currencyValue = denomTranslate.denomValue;


            return(denomTranslate);
        }
Ejemplo n.º 3
0
        public static denomTranslation returnNoteInfo(string noteSpCode)
        {
            denomTranslation        noteInfo      = new denomTranslation();
            List <denomTranslation> noteInfoArray = createNoteInfoArray();

            foreach (denomTranslation noteInf in noteInfoArray)
            {
                if (noteInf.spCode.ToString() == noteSpCode)
                {
                    noteInfo = noteInf;
                }
            }
            return(noteInfo);
        }
Ejemplo n.º 4
0
        public static List <denomTranslation> createNoteInfoArray()
        {
            List <denomTranslation> noteIdsArray = new List <denomTranslation>();

            string[] noteIdLinesFromFile = File.ReadAllLines(AppDomain.CurrentDomain.BaseDirectory + @"\noteIds.txt");
            foreach (string line in noteIdLinesFromFile)
            {
                denomTranslation noteId      = new denomTranslation();
                string[]         noteIdArray = line.Split(',');
                noteId.spCode     = Convert.ToInt16(noteIdArray[0]);
                noteId.denomValue = Convert.ToInt16(noteIdArray[1]);
                noteId.denomType  = noteIdArray[2];
                noteIdsArray.Add(noteId);
            }
            return(noteIdsArray);
        }
Ejemplo n.º 5
0
        public static List <denomTranslation> displayCashInCurrencyValueCount(List <cashUnit.asDenomInfo> denomList)
        {
            List <denomTranslation> noteInfoList = new List <denomTranslation>();
            denomTranslation        noteInfo     = new denomTranslation();

            foreach (cashUnit.asDenomInfo denomInfo in denomList)
            {
                denomTranslation denTra = denomTranslation.returnCurrencyTypeValue(denomInfo.iCode);
                denTra.denomCount = denomInfo.iNum;



                noteInfoList.Add(denTra);
            }

            return(noteInfoList);
        }
Ejemplo n.º 6
0
        public static void fillRichTextBox(List <cashUnit.lppCashIn> allCashInArray)
        {
            Form1       myForm       = new Form1();
            RichTextBox richTextBox1 = myForm.Controls["richTextBox1"] as RichTextBox;

            richTextBox1.Text = "";
            foreach (cashUnit.lppCashIn lppCashInObjectl in allCashInArray)
            {
                if (lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray.Count() == 0)
                {
                    richTextBox1.Text = "No Cash In Transaction.";
                }
                else if (lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray.Count() == 1)
                {
                    richTextBox1.AppendText("Request ID: " + lppCashInObjectl.requestId + "\r\n");
                    richTextBox1.AppendText("Currency: " + lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray[0].usNoteID + "\r\n");
                    denomTranslation noteValue = denomTranslation.returnNoteInfo(lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray[0].usNoteID);

                    richTextBox1.AppendText("Denomination: " + noteValue.denomType + "\r\n");
                    richTextBox1.AppendText("Value: " + noteValue.denomValue + "\r\n");
                    richTextBox1.AppendText("Amount: " + lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray[0].ulCount + "\r\n");
                    richTextBox1.AppendText("Cash Unit: " + lppCashInObjectl.fwType + "\r\n");
                    //richTextBox1.AppendText(spLogFile.Name);
                    richTextBox1.AppendText("------------------------------------------------------------------------\r\n");
                }
                if (lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray.Count() > 1)
                {
                    for (int lppNoteNumberCount = 0; lppNoteNumberCount < lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray.Count(); lppNoteNumberCount++)
                    {
                        richTextBox1.AppendText("Request ID: " + lppCashInObjectl.requestId + "\r\n");
                        richTextBox1.AppendText("Currency: " + lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray[lppNoteNumberCount].usNoteID + "\r\n");
                        denomTranslation noteValue = denomTranslation.returnNoteInfo(lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray[lppNoteNumberCount].usNoteID);

                        richTextBox1.AppendText("Denomination: " + noteValue.denomType + "\r\n");
                        richTextBox1.AppendText("Value: " + noteValue.denomValue + "\r\n");
                        richTextBox1.AppendText("Amount: " + lppCashInObjectl.lppNoteNumberListStruct.lppNoteNumberStructArray[lppNoteNumberCount].ulCount + "\r\n");
                        richTextBox1.AppendText("Cash Unit: " + lppCashInObjectl.fwType + "\r\n");
                        //richTextBox1.AppendText(spLogFile.Name);

                        richTextBox1.AppendText("------------------------------------------------------------------------\r\n");
                    }
                }
            }
        }
        public static List <denomTranslation> totalDeposit(List <spLogListener.cashUnit.lppCashIn> allCashInArray)
        {
            List <string>           distinctDenoms        = denomTranslation.returnDistinctDenomTypes();
            List <string>           totalDepositOut       = new List <string>();
            List <denomTranslation> totalDepositDenomList = new List <denomTranslation>();
            int    totalDeposit = 0;
            string denomTypeOut = "";

            foreach (cashUnit.lppCashIn lppCashIn in allCashInArray)
            {
                if (lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray.Count() == 1)
                {
                    denomTranslation noteValue = denomTranslation.returnNoteInfo(lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray[0].usNoteID);
                    denomTypeOut = noteValue.denomType;
                    foreach (string denomType in distinctDenoms)
                    {
                        if (noteValue.denomType == denomType)
                        {
                            int depositValue = noteValue.denomValue * lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray[0].ulCount;
                            totalDeposit         += depositValue;
                            noteValue.denomTotal += depositValue;
                            noteValue.denomType   = denomType;
                            //noteValue.denomValue = depositValue;
                            noteValue.denomCount = lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray[0].ulCount;
                            noteValue.requestID  = lppCashIn.requestId;
                            totalDepositDenomList.Add(noteValue);
                        }
                    }
                    totalDepositOut.Add("Total " + noteValue.denomType + " deposited: " + totalDeposit.ToString());
                    //richTextBox2.Text = ("Total " + noteValue.denomType + " deposited: " + totalDeposit.ToString());
                }
                else if (lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray.Count() > 1)
                {
                    for (int lppNoteNumberCount = 0; lppNoteNumberCount < lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray.Count(); lppNoteNumberCount++)
                    {
                        denomTranslation noteValue = denomTranslation.returnNoteInfo(lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray[lppNoteNumberCount].usNoteID);
                        denomTypeOut = noteValue.denomType;
                        foreach (string denomType in distinctDenoms)
                        {
                            if (noteValue.denomType == denomType)
                            {
                                int depositValue = noteValue.denomValue * lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray[lppNoteNumberCount].ulCount;
                                totalDeposit         += depositValue;
                                noteValue.denomTotal += depositValue;
                                noteValue.denomType   = denomType;
                                //noteValue.denomValue = depositValue;
                                noteValue.denomCount = lppCashIn.lppNoteNumberListStruct.lppNoteNumberStructArray[lppNoteNumberCount].ulCount;
                                noteValue.requestID  = lppCashIn.requestId;


                                totalDepositDenomList.Add(noteValue);
                            }
                        }
                        //totalDepositOut.Add("Total " + noteValue.denomType + " deposited: " + totalDeposit.ToString());
                        //richTextBox2.Text = ("Total " + noteValue.denomType + " deposited: " + totalDeposit.ToString());
                    }
                }
            }
            processTotalDepositDenomList(totalDepositDenomList);
            return(totalDepositDenomList);
        }
        public static void compareCashInObjects(List <List <cashUnit.compareObject> > compareObjects)
        {
            denomTranslation cashCompareDenom = new denomTranslation();
            List <int>       totalAmount      = new List <int>();
            int compareObjectAmount           = 0;

            foreach (List <cashUnit.compareObject> compareObjectList in compareObjects)
            {
                compareObjectAmount = 0;
                if (compareObjectList.Count == 1)
                {
                    for (int i = 0; i < compareObjectList.Count; i++)
                    {
                        cashCompareDenom = denomTranslation.returnNoteInfo(compareObjectList[i].iCode);
                        totalAmount.Add(cashCompareDenom.denomValue * compareObjectList[i].iCount);
                    }
                }
                else
                {
                    for (int i = 0; i < compareObjectList.Count; i++)
                    {
                        cashCompareDenom     = denomTranslation.returnNoteInfo(compareObjectList[i].iCode);
                        compareObjectAmount += cashCompareDenom.denomValue * compareObjectList[i].iCount;
                    }

                    totalAmount.Add(compareObjectAmount);
                }
            }



            RichTextBox rtxt  = Application.OpenForms["Form1"].Controls["richTextBox2"] as RichTextBox;
            RichTextBox rtxt1 = Application.OpenForms["Form1"].Controls["richTextBox3"] as RichTextBox;


            int totalOfArray = (totalAmount[0] + totalAmount[1] + totalAmount[2] + totalAmount[3] + totalAmount[4] + totalAmount[5]);


            if (totalAmount[5] == 0 && (totalAmount[0] + totalAmount[1] + totalAmount[2] + totalAmount[3] + totalAmount[4] + totalAmount[5]) / 4 == totalAmount[0])
            {
                rtxt.ForeColor = System.Drawing.Color.Black;
                rtxt.Text     += "iCashCount :" + totalAmount[0] + "\r\n";
                rtxt.Text     += "hrCashIn :" + totalAmount[1] + "\r\n";
                rtxt.Text     += "iStoreMoneyEx :" + totalAmount[2] + "\r\n";
                rtxt.Text     += "hrCashInEnd :" + totalAmount[3] + "\r\n";
                rtxt.Text     += "cashInEnd :" + totalAmount[4] + "\r\n";
                rtxt.Text     += "iRetract :" + totalAmount[5] + "\r\n";
                //rtxt.Text += "Date Time : " + compareObjects[0][0].compareObjectDateTime + "\r\n";
                rtxt.Text += "------------------------------------------------------------\r\n";
            }

            else if (totalAmount[5] != 0 && (totalAmount[0] + totalAmount[1] + totalAmount[2] + totalAmount[3] + totalAmount[4] + totalAmount[5]) / 4 == totalAmount[0])
            {
                rtxt.ForeColor = System.Drawing.Color.Black;
                rtxt.Text     += "iCashCount :" + totalAmount[0] + "\r\n";
                rtxt.Text     += "hrCashIn :" + totalAmount[1] + "\r\n";
                rtxt.Text     += "iStoreMoneyEx :" + totalAmount[2] + "\r\n";
                rtxt.Text     += "hrCashInEnd :" + totalAmount[3] + "\r\n";
                rtxt.Text     += "cashInEnd :" + totalAmount[4] + "\r\n";
                rtxt.Text     += "iRetract :" + totalAmount[5] + "\r\n";
                //rtxt.Text += "Date Time : " + compareObjects[0][0].compareObjectDateTime + "\r\n";
                rtxt.Text += "------------------------------------------------------------\r\n";
            }
            else
            {
                rtxt1.ForeColor = System.Drawing.Color.Red;
                rtxt1.Text     += "iCashCount :" + totalAmount[0] + "\r\n";
                rtxt1.Text     += "hrCashIn :" + totalAmount[1] + "\r\n";
                rtxt1.Text     += "iStoreMoneyEx :" + totalAmount[2] + "\r\n";
                rtxt1.Text     += "hrCashInEnd :" + totalAmount[3] + "\r\n";
                rtxt1.Text     += "cashInEnd :" + totalAmount[4] + "\r\n";
                rtxt1.Text     += "iRetract :" + totalAmount[5] + "\r\n";
                //rtxt1.Text += "Date Time : " + compareObjects[0][0].compareObjectDateTime + "\r\n";
                rtxt1.Text += "------------------------------------------------------------\r\n";
            }
            cashCountTotal   += totalAmount[0];
            hrCashInTotal    += totalAmount[1];
            iStoreMoneyTotal += totalAmount[2];
            hrCashInEndTotal += totalAmount[3];
            cashInEndTotal   += totalAmount[4];
            iRetractTotal    += totalAmount[5];
            //iCashCountCompareObjectList, hrCashInCompareObjectList, iStoreMoneyExCompareObjectList, hrCashInEndCompareObjectList, cashInEndCompareObjectList
        }
        public static string createCompareObjects(List <cashUnit.lppCashIn> cashInEndObjectList, List <cashUnit.iCashCount> iCashCountObjectList, List <cashUnit.hrCashIn> hrCashInObjectList, List <cashUnit.iStoreMoneyEx> iStoreMoneyExObjectList, List <cashUnit.hrCashInEnd> hrCashInEndObjectList, cashUnit.wfsCmdCimCashIn wfsCmdCimCashInObject, cashUnit.iRetractEnd iRetractEndObject)
        {
            cashUnit.compareObject        iCashCountCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> iCashCountCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        hrCashInCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> hrCashInCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        wfsCmdCimCashInCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> wfsCmdCimCashInCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        iStoreMoneyExCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> iStoreMoneyExCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        hrCashInEndCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> hrCashInEndCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        cashInEndCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> cashInEndCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        iRetractEndCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> iRetractEndCompareObjectList = new List <cashUnit.compareObject>();

            string result = "";


            foreach (cashUnit.iCashCount iCashCountObject in iCashCountObjectList)
            {
                for (int i = 0; i < iCashCountObject.denomInfoList.Count(); i++)
                {
                    denomTranslation noteValue = denomTranslation.returnNoteInfo(iCashCountObject.denomInfoList[i].iCode);
                    iCashCountCompareObject.iCode  = iCashCountObject.denomInfoList[i].iCode;
                    iCashCountCompareObject.iCount = iCashCountObject.denomInfoList[i].iNum;
                    iCashCountCompareObject.compareObjectDateTime = iCashCountObject.iCashCountDateTime;
                    iCashCountCompareObjectList.Add(iCashCountCompareObject);
                }
            }

            foreach (cashUnit.hrCashIn hrCashInObject in hrCashInObjectList)
            {
                for (int i = 0; i < hrCashInObject.acceptList.Count; i++)
                {
                    denomTranslation noteValue = denomTranslation.returnNoteInfo(hrCashInObject.acceptList[i].code);

                    hrCashInCompareObject.iCode  = hrCashInObject.acceptList[i].code;
                    hrCashInCompareObject.iCount = hrCashInObject.acceptList[i].count;
                    hrCashInCompareObject.compareObjectDateTime = hrCashInObject.hrCashInDateTime;

                    hrCashInCompareObjectList.Add(hrCashInCompareObject);
                }
            }


            foreach (cashUnit.lppNoteNumber lppNumberList in wfsCmdCimCashInObject.lppNoteNumberListStruct.lppNoteNumberStructArray)
            {
                wfsCmdCimCashInCompareObject.iCode  = lppNumberList.usNoteID;
                wfsCmdCimCashInCompareObject.iCount = lppNumberList.ulCount;
                wfsCmdCimCashInCompareObjectList.Add(wfsCmdCimCashInCompareObject);
            }

            foreach (cashUnit.iStoreMoneyEx iStoreMoneyExObject in iStoreMoneyExObjectList)
            {
                for (int i = 0; i < iStoreMoneyExObject.denomInfoList.Count; i++)
                {
                    iStoreMoneyExCompareObject.iCode  = iStoreMoneyExObject.denomInfoList[i].iCode;
                    iStoreMoneyExCompareObject.iCount = iStoreMoneyExObject.denomInfoList[i].iNum;
                    iStoreMoneyExCompareObject.compareObjectDateTime = iStoreMoneyExObject.iStoreMoneyExDateTime;
                    iStoreMoneyExCompareObjectList.Add(iStoreMoneyExCompareObject);
                }
            }

            foreach (cashUnit.hrCashInEnd hrCashInEndObject in hrCashInEndObjectList)
            {
                for (int i = 0; i < hrCashInEndObject.cashInEndResultList.Count; i++)
                {
                    hrCashInEndCompareObject.cassetteID            = "S" + hrCashInEndObject.cashInEndResultList[i].slot + "_I" + hrCashInEndObject.cashInEndResultList[i].index;
                    hrCashInEndCompareObject.iCount                = hrCashInEndObject.cashInEndResultList[i].count;
                    hrCashInEndCompareObject.compareObjectDateTime = hrCashInEndObject.hrCashInEndDateTime;
                    hrCashInEndCompareObjectList.Add(hrCashInEndCompareObject);
                }
            }


            foreach (cashUnit.lppCashIn cashInEndObject in cashInEndObjectList)
            {
                for (int i = 0; i < cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray.Count(); i++)
                {
                    cashInEndCompareObject.cassetteID            = cashInEndObject.cUnitID;
                    cashInEndCompareObject.iCode                 = cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray[i].usNoteID;
                    cashInEndCompareObject.iCount                = cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray[i].ulCount;
                    cashInEndCompareObject.cassetteID            = cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray[i].lppPhysicalstruct.lpPhysicalPositionName;
                    cashInEndCompareObject.compareObjectDateTime = cashInEndObject.lppCashInDateTime;
                    cashInEndCompareObjectList.Add(cashInEndCompareObject);
                }
            }

            if (iRetractEndObject.denomInfoList != null)
            {
                foreach (cashUnit.asDenomInfo asDenomInfoList in iRetractEndObject.denomInfoList)
                {
                    iRetractEndCompareObject.iCode  = asDenomInfoList.iCode;
                    iRetractEndCompareObject.iCount = Convert.ToInt16(asDenomInfoList.iNum);
                    iRetractEndCompareObject.compareObjectDateTime = iRetractEndObject.iRetractEndDateTime;
                    iRetractEndCompareObjectList.Add(iRetractEndCompareObject);
                }
            }

            foreach (cashUnit.compareObject obj in iCashCountCompareObjectList)
            {
                result += "iCashCount:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            foreach (cashUnit.compareObject obj in hrCashInCompareObjectList)
            {
                result += "hrCashIn:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            foreach (cashUnit.compareObject obj in iStoreMoneyExCompareObjectList)
            {
                result += "iStoreMoneyEx:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            foreach (cashUnit.compareObject obj in hrCashInEndCompareObjectList)
            {
                result += "hrCashInEnd:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }


            foreach (cashUnit.compareObject obj in cashInEndCompareObjectList)
            {
                result += "cashInEnd:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            foreach (cashUnit.compareObject obj in iRetractEndCompareObjectList)
            {
                result += "iRetractEnd:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            List <List <cashUnit.compareObject> > compareObjects = new List <List <cashUnit.compareObject> > {
                iCashCountCompareObjectList, hrCashInCompareObjectList, iStoreMoneyExCompareObjectList, hrCashInEndCompareObjectList, cashInEndCompareObjectList, iRetractEndCompareObjectList
            };

            compareCashInObjects(compareObjects);

            RichTextBox rtxt = Application.OpenForms["Form1"].Controls["richTextBox1"] as RichTextBox;

            rtxt.Text += result;
            return(result);
        }