Beispiel #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;
        }
Beispiel #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;
 }
Beispiel #5
0
 public void Refresh(string strMembershipID, int nCategoryID)
 {
     ACMSDAL.TblReceipt receipt = new ACMSDAL.TblReceipt();
     myDataTable = receipt.GetValidReceiptBaseCategoryID(strMembershipID, nCategoryID);
     Init();
 }
Beispiel #6
0
        public void RefreshDeposit()
        {
            string cmdtext = "";
            //if (myIsMember)
            //{
            if (mySalesCategoryID == 6)
            {
                cmdtext = " Select strReceiptNo,strDescription,mNettAmount from tblReceipt R inner join tblCategory C on R.ncategoryID = C.ncategoryID" +
                               " where R.fDeposit <> '' and R.StrMembershipID = @ID AND C.nSalesCategoryID IN (1,2,6)" +
                               //" Union select cast(c.nPackageID as varchar(10)) as strReceiptNo,'Upgrade' as strDescription,mConverted as mNettAmount from tblmemberpackageconvertion c" +
                               " Union select strReceiptNo,'Upgrade' as strDescription,mConverted as mNettAmount from tblmemberpackageconvertion c" +
                               " inner join tblmemberpackage mp on c.nPackageID = mp.nPackageID where mp.strMembershipID= @ID AND C.nSalesCategory IN (1,2,6) and c.nStatusID = 0";

                ACMSDAL.TblReceipt Receipt = new ACMSDAL.TblReceipt();
                myDataTable = Receipt.LoadData(cmdtext, new string[] { "@ID", "@nSalesCategoryID" },
                    new object[] { myID, mySalesCategoryID });

                Init();
            }
            else
            {
                cmdtext = " Select strReceiptNo,strDescription,mNettAmount from tblReceipt R inner join tblCategory C on R.ncategoryID = C.ncategoryID" +
                        " where R.fDeposit <> '' and R.StrMembershipID = @ID  AND C.nSalesCategoryID = @nSalesCategoryID and R.fVoid=0 " +
                        //" Union select cast(c.nPackageID as varchar(10)) as strReceiptNo,'Upgrade' as strDescription,mConverted as mNettAmount from tblmemberpackageconvertion c" +
                         " Union select strReceiptNo,'Upgrade' as strDescription,mConverted as mNettAmount from tblmemberpackageconvertion c" +
                        " inner join tblmemberpackage mp on c.nPackageID = mp.nPackageID where mp.strMembershipID= @ID AND C.nSalesCategory = @nSalesCategoryID and c.nStatusID = 0" +
                        " Union select strReceiptNo,'Upgrade Credit' as strDescription,mConverted as mNettAmount from tblmemberpackageconvertion c" +
                        " inner join tblmembercreditpackage mc on c.nPackageID = mc.nCreditPackageID where mc.strMembershipID= @ID AND C.nSalesCategory = @nSalesCategoryID and c.nStatusID = 0";
                //}
                if (mySalesCategoryID == 1 || mySalesCategoryID == 2)
                    cmdtext = string.Concat(cmdtext, " Union Select strReceiptNo,strDescription,mNettAmount from tblReceipt R inner join tblCategory C on R.ncategoryID = C.ncategoryID where R.fDeposit <> '' and R.StrMembershipID = @ID AND fVoid=0 AND C.nSalesCategoryID = 9 ");

                ACMSDAL.TblReceipt Receipt = new ACMSDAL.TblReceipt();
                myDataTable = Receipt.LoadData(cmdtext, new string[] { "@ID", "@nSalesCategoryID" },
                    new object[] { myID, mySalesCategoryID });

                Init();
            }
        }