Exemplo n.º 1
0
        public Result Find(int docNum)
        {
            Action find = delegate
            {
                var sqlBuilder = new StringBuilder();
                sqlBuilder.AppendFormat("SELECT * FROM `OR` WHERE DOC_NUM = ?DOC_NUM");

                var sqlParam = new SqlParameter("?DOC_NUM", docNum);

                DataTable result = DatabaseController.ExecuteSelectQuery(sqlBuilder.ToString(),
                                                                         sqlParam);

                ResetProperties();
                VoucherNumber = docNum;
                string cashOnHandCode  = GlobalSettings.CodeOfCashOnHand;
                string timeDepositCode = GlobalSettings.CodeOfTimeDeposit;

                int index = 0;
                foreach (DataRow dataRow in result.Rows)
                {
                    if (index == 0)
                    {
                        VoucherDate   = DataConverter.ToDateTime(dataRow["DOC_DATE"]);
                        MemberCode    = DataConverter.ToString(dataRow["MEM_CODE"]);
                        IsCancelled   = MemberCode.ToUpper().Contains("CANCEL");
                        CollectorName = DataConverter.ToString(dataRow["COLLECTOR"]);
                    }

                    index++;

                    string  accountCode = DataConverter.ToString(dataRow["ACC_CODE"]);
                    decimal credit      = DataConverter.ToDecimal(dataRow["CREDIT"]);

                    if (accountCode != cashOnHandCode)
                    {
                        SetAccountCode(index, accountCode);
                        SetCreditAmount(index, credit);
                        if (accountCode == timeDepositCode)
                        {
                            TimeDepositDetail = TimeDepositDetails.ExtractFromDataRow(dataRow);
                        }
                    }
                    else
                    {
                        CashAndCheckDenomimation = CashAndCheckBreakDown.ExtractFromDataRow(dataRow);
                    }
                }

                //UpdateTotalAmount();
            };

            return(ActionController.InvokeAction(find));
        }
Exemplo n.º 2
0
        internal static CashAndCheckBreakDown ExtractFromDataRow(System.Data.DataRow dataRow)
        {
            var breakDown = new CashAndCheckBreakDown();

            breakDown.Deno01 = DataConverter.ToInteger(dataRow["DEN1"]);
            breakDown.Deno02 = DataConverter.ToInteger(dataRow["DEN2"]);
            breakDown.Deno03 = DataConverter.ToInteger(dataRow["DEN3"]);
            breakDown.Deno04 = DataConverter.ToInteger(dataRow["DEN4"]);
            breakDown.Deno05 = DataConverter.ToInteger(dataRow["DEN5"]);
            breakDown.Deno06 = DataConverter.ToInteger(dataRow["DEN6"]);
            breakDown.Deno07 = DataConverter.ToInteger(dataRow["DEN7"]);
            breakDown.Deno08 = DataConverter.ToInteger(dataRow["DEN8"]);
            breakDown.Deno09 = DataConverter.ToInteger(dataRow["DEN9"]);
            breakDown.Deno10 = DataConverter.ToInteger(dataRow["DEN10"]);

            breakDown.BankName1 = DataConverter.ToString(dataRow["BNAME1"]);
            breakDown.BankName2 = DataConverter.ToString(dataRow["BNAME2"]);
            breakDown.BankName3 = DataConverter.ToString(dataRow["BNAME3"]);
            breakDown.BankName4 = DataConverter.ToString(dataRow["BNAME4"]);
            breakDown.BankName5 = DataConverter.ToString(dataRow["BNAME5"]);

            breakDown.BankCheck1 = DataConverter.ToString(dataRow["BCHECK1"]);
            breakDown.BankCheck2 = DataConverter.ToString(dataRow["BCHECK2"]);
            breakDown.BankCheck3 = DataConverter.ToString(dataRow["BCHECK3"]);
            breakDown.BankCheck4 = DataConverter.ToString(dataRow["BCHECK4"]);
            breakDown.BankCheck5 = DataConverter.ToString(dataRow["BCHECK5"]);

            breakDown.BankDate1 = DataConverter.ToDateTime(dataRow["BDATE1"]);
            breakDown.BankDate2 = DataConverter.ToDateTime(dataRow["BDATE2"]);
            breakDown.BankDate3 = DataConverter.ToDateTime(dataRow["BDATE3"]);
            breakDown.BankDate4 = DataConverter.ToDateTime(dataRow["BDATE4"]);
            breakDown.BankDate5 = DataConverter.ToDateTime(dataRow["BDATE5"]);

            breakDown.BankAmount1 = DataConverter.ToDecimal(dataRow["BAMT1"]);
            breakDown.BankAmount2 = DataConverter.ToDecimal(dataRow["BAMT2"]);
            breakDown.BankAmount3 = DataConverter.ToDecimal(dataRow["BAMT3"]);
            breakDown.BankAmount4 = DataConverter.ToDecimal(dataRow["BAMT4"]);
            breakDown.BankAmount5 = DataConverter.ToDecimal(dataRow["BAMT5"]);

            return(breakDown);
        }
Exemplo n.º 3
0
        public void Copy(CashAndCheckBreakDown model)
        {
            if (model == null)
            {
                return;
            }
            Deno01 = model.Deno01;
            Deno02 = model.Deno02;
            Deno03 = model.Deno03;
            Deno04 = model.Deno04;
            Deno05 = model.Deno05;
            Deno06 = model.Deno06;
            Deno07 = model.Deno07;
            Deno08 = model.Deno08;
            Deno09 = model.Deno09;
            Deno10 = model.Deno10;

            BankName1 = model.BankName1;
            BankName2 = model.BankName2;
            BankName3 = model.BankName3;
            BankName4 = model.BankName4;
            BankName5 = model.BankName5;

            BankDate1 = model.BankDate1;
            BankDate2 = model.BankDate2;
            BankDate3 = model.BankDate3;
            BankDate4 = model.BankDate4;
            BankDate5 = model.BankDate5;

            BankCheck1 = model.BankCheck1;
            BankCheck2 = model.BankCheck2;
            BankCheck3 = model.BankCheck3;
            BankCheck4 = model.BankCheck4;
            BankCheck5 = model.BankCheck5;

            BankAmount1 = model.BankAmount1;
            BankAmount2 = model.BankAmount2;
            BankAmount3 = model.BankAmount3;
            BankAmount4 = model.BankAmount4;
            BankAmount5 = model.BankAmount5;
        }