示例#1
0
        private void GetChild(string Parent)
        {
            string[]           ChildNodes = new string[100], MultiNodes = new string[100];
            ACMSDAL.TblReceipt myChild    = new ACMSDAL.TblReceipt();
            myChild.StrReceiptNo = Parent;
            DataTable tblChild = myChild.SelectOne();

            if (tblChild.Rows.Count > 0 && tblChild.Rows[0]["strChildReceiptNo"].ToString() != "")
            {
                ChildNodes[0] = tblChild.Rows[0]["strChildReceiptNo"].ToString();
                strChild      = strChild + ChildNodes[0].ToString() + ",";
            }
            SplitChild(strChild);
            //return tblChild;
        }
示例#2
0
        private decimal GetTotalPayment(string strReceipt)
        {
            ACMSDAL.TblReceipt myReceipt = new ACMSDAL.TblReceipt();
            myReceipt.StrReceiptNo = strReceipt;
            DataTable tblReceiptPaid = myReceipt.SelectOne();

            if (tblReceiptPaid.Rows[0]["strParentReceiptNo"].ToString() == "" && tblReceiptPaid.Rows[0]["strChildReceiptNo"].ToString() == "")
            {
                // Add payment for full payment
                mPayAmount = GetPayment(strReceipt) / System.Convert.ToDecimal("1.07");
            }
            // Get the Parent Total paid amount from tblmemberpackage + this receipt Total Payment
            else if (tblReceiptPaid.Rows[0]["strParentReceiptNo"].ToString() != "")
            {
                ACMSDAL.TblMemberPackage myMemberPackage = new ACMSDAL.TblMemberPackage();
                myMemberPackage.StrReceiptNo = tblReceiptPaid.Rows[0]["strParentReceiptNo"].ToString();
                myMemberPackage.SelectOneReceipt();
                decimal mParentTotal = myMemberPackage.MTotalPaid.ToDecimal();
                decimal mNetPayAmount;
                if (System.Convert.ToDateTime(tblReceiptPaid.Rows[0]["dtdate"]) < System.Convert.ToDateTime("01/Jul/2007"))
                {
                    mPayAmount = GetPayment(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString()) / System.Convert.ToDecimal("1.05") + mParentTotal;
                }
                else
                {
                    mPayAmount = GetPayment(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString()) / System.Convert.ToDecimal("1.07") + mParentTotal;
                }

                GetChild(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString());
                if (strChild != null)
                {
                    string[] arrSubTask = strChild.Substring(0, strChild.Length - 1).Split(',');
                    for (int j = 0; j < arrSubTask.Length; j++)
                    {
                        mNetPayAmount = GetPayment(arrSubTask[j].ToString());
                        if (System.Convert.ToDateTime(tblReceiptPaid.Rows[0]["dtdate"]) < System.Convert.ToDateTime("01/Jul/2007"))
                        {
                            mNetPayAmount = mNetPayAmount / System.Convert.ToDecimal("1.05");
                        }
                        else
                        {
                            mNetPayAmount = mNetPayAmount / System.Convert.ToDecimal("1.07");
                        }

                        mPayAmount = mPayAmount + mNetPayAmount;
                    }
                }
            }
            else if (tblReceiptPaid.Rows[0]["strChildReceiptNo"].ToString() != "")
            {
                // Add payment for the receipt and find the child receipt and add back
                // decimal mReceiptAmount;
                decimal mNetPayAmount;

                if (System.Convert.ToDateTime(tblReceiptPaid.Rows[0]["dtdate"]) < System.Convert.ToDateTime("01/Jul/2007"))
                {
                    mPayAmount = GetPayment(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString()) / System.Convert.ToDecimal("1.05");
                }
                else
                {
                    mPayAmount = GetPayment(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString()) / System.Convert.ToDecimal("1.07");
                }

                //this.a_audit_spaTableAdapter.GetPaidAmount(tblReceiptPaid.Rows[i]["strChildReceiptNo"].ToString());
                GetChild(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString());
                string[] arrSubTask = strChild.Substring(0, strChild.Length - 1).Split(',');
                for (int j = 0; j < arrSubTask.Length; j++)
                {
                    mNetPayAmount = GetPayment(arrSubTask[j].ToString());
                    if (System.Convert.ToDateTime(tblReceiptPaid.Rows[0]["dtdate"]) < System.Convert.ToDateTime("01/Jul/2007"))
                    {
                        mNetPayAmount = mNetPayAmount / System.Convert.ToDecimal("1.05");
                    }
                    else
                    {
                        mNetPayAmount = mNetPayAmount / System.Convert.ToDecimal("1.07");
                    }

                    mPayAmount = mPayAmount + mNetPayAmount;

                    // this.a_audit_spaTableAdapter.updatePaidAmount(mReceiptAmount, tblReceiptPaid.Rows[0]["strReceiptNo"].ToString());
                }
            }

            return(mPayAmount);
        }
        private decimal GetTotalPayment( string strReceipt)
        {
            ACMSDAL.TblReceipt myReceipt = new ACMSDAL.TblReceipt();
            myReceipt.StrReceiptNo = strReceipt;
            DataTable tblReceiptPaid = myReceipt.SelectOne();

            if (tblReceiptPaid.Rows[0]["strParentReceiptNo"].ToString() == "" && tblReceiptPaid.Rows[0]["strChildReceiptNo"].ToString() == "")
                {
                    // Add payment for full payment
                    mPayAmount = GetPayment(strReceipt) / System.Convert.ToDecimal("1.07");
                }
            // Get the Parent Total paid amount from tblmemberpackage + this receipt Total Payment
            else if (tblReceiptPaid.Rows[0]["strParentReceiptNo"].ToString() != "")
            {
                ACMSDAL.TblMemberPackage myMemberPackage = new ACMSDAL.TblMemberPackage();
                myMemberPackage.StrReceiptNo = tblReceiptPaid.Rows[0]["strParentReceiptNo"].ToString();
                myMemberPackage.SelectOneReceipt();
                decimal mParentTotal = myMemberPackage.MTotalPaid.ToDecimal();
                decimal mNetPayAmount;
                if (System.Convert.ToDateTime(tblReceiptPaid.Rows[0]["dtdate"]) < System.Convert.ToDateTime("01/Jul/2007"))
                    mPayAmount = GetPayment(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString()) / System.Convert.ToDecimal("1.05") + mParentTotal;
                else
                    mPayAmount = GetPayment(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString()) / System.Convert.ToDecimal("1.07") + mParentTotal;

                GetChild(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString());
                if (strChild != null)
                {
                    string[] arrSubTask = strChild.Substring(0, strChild.Length - 1).Split(',');
                    for (int j = 0; j < arrSubTask.Length; j++)
                    {
                        mNetPayAmount = GetPayment(arrSubTask[j].ToString());
                        if (System.Convert.ToDateTime(tblReceiptPaid.Rows[0]["dtdate"]) < System.Convert.ToDateTime("01/Jul/2007"))
                            mNetPayAmount = mNetPayAmount / System.Convert.ToDecimal("1.05");
                        else
                            mNetPayAmount = mNetPayAmount / System.Convert.ToDecimal("1.07");

                        mPayAmount = mPayAmount + mNetPayAmount;

                    }
                }
            }
                else if (tblReceiptPaid.Rows[0]["strChildReceiptNo"].ToString() != "")
                {
                    // Add payment for the receipt and find the child receipt and add back
                   // decimal mReceiptAmount;
                    decimal mNetPayAmount;

                    if (System.Convert.ToDateTime(tblReceiptPaid.Rows[0]["dtdate"]) < System.Convert.ToDateTime("01/Jul/2007"))
                        mPayAmount = GetPayment(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString()) / System.Convert.ToDecimal("1.05");
                    else
                        mPayAmount = GetPayment(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString()) / System.Convert.ToDecimal("1.07");

                    //this.a_audit_spaTableAdapter.GetPaidAmount(tblReceiptPaid.Rows[i]["strChildReceiptNo"].ToString());
                    GetChild(tblReceiptPaid.Rows[0]["strReceiptNo"].ToString());
                    string[] arrSubTask = strChild.Substring(0, strChild.Length - 1).Split(',');
                    for (int j = 0; j < arrSubTask.Length; j++)
                    {
                        mNetPayAmount = GetPayment(arrSubTask[j].ToString());
                        if (System.Convert.ToDateTime(tblReceiptPaid.Rows[0]["dtdate"]) < System.Convert.ToDateTime("01/Jul/2007"))
                            mNetPayAmount = mNetPayAmount / System.Convert.ToDecimal("1.05");
                        else
                            mNetPayAmount = mNetPayAmount / System.Convert.ToDecimal("1.07");

                        mPayAmount = mPayAmount + mNetPayAmount;

                       // this.a_audit_spaTableAdapter.updatePaidAmount(mReceiptAmount, tblReceiptPaid.Rows[0]["strReceiptNo"].ToString());

                    }

                }

            return mPayAmount;
        }
 private void GetChild(string Parent)
 {
     string[] ChildNodes = new string[100], MultiNodes = new string[100];
     ACMSDAL.TblReceipt myChild = new ACMSDAL.TblReceipt();
     myChild.StrReceiptNo = Parent;
     DataTable tblChild = myChild.SelectOne();
     if (tblChild.Rows.Count > 0 && tblChild.Rows[0]["strChildReceiptNo"].ToString() != "")
     {
         ChildNodes[0] = tblChild.Rows[0]["strChildReceiptNo"].ToString();
         strChild = strChild + ChildNodes[0].ToString() + ",";
     }
     SplitChild(strChild);
     //return tblChild;
 }