Esempio n. 1
0
        private void PrintIntroReceipt(string CurrentMembershipID, string IntroMembershipID, DataTable FreebieCode)
        {
            // MembershipCurrentMemberName
            ACMSLogic.Printing myReceiptPrinting = new  ACMSLogic.Printing();
            myReceiptPrinting.WriteLine(ACMSLogic.Common.ReceiptContent.STR_COMPANY_NAME);
            myReceiptPrinting.WriteLine(ACMSLogic.Common.ReceiptContent.STR_INTRODUCEFRIENDSHEADER);
            myReceiptPrinting.WriteLine(string.Format("Branch : {0}", User.BranchCode));
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine(string.Format("Membership ID : {0}", CurrentMembershipID));
            string strLine = DateTime.Now.ToString("dd/MM/yyyy  hh:mm tt");

            myReceiptPrinting.WriteLine("Rewards Date : " + strLine);
            myReceiptPrinting.WriteLine("");
            for (int i = 0; i < FreebieCode.Rows.Count; i++)
            {
                myReceiptPrinting.WriteLine(string.Format("Free Gift : {0}", FreebieCode.Rows[i]["strDescription"].ToString()));
                myReceiptPrinting.WriteLine("");
            }
            myReceiptPrinting.WriteLine(string.Format("Introducer ID: {0}", IntroMembershipID));
//			myReceiptPrinting.WriteLine("");
//			myReceiptPrinting.WriteLine(string.Format("Points Earned: {0}", pointEarned));
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("_________________________________________");
            myReceiptPrinting.WriteLine(string.Format("VERIFIED BY  {0}", CurrentMembershipID));
            myReceiptPrinting.Print();
        }
Esempio n. 2
0
        private void PrintIntroReceipt(string CurrentMembershipID, string IntroMembershipID, double pointEarned, string RewardType)
        {
            // MembershipCurrentMemberName
            ACMSLogic.Printing myReceiptPrinting = new  ACMSLogic.Printing();
            myReceiptPrinting.WriteLine(ACMSLogic.Common.ReceiptContent.STR_COMPANY_NAME);
            myReceiptPrinting.WriteLine(ACMSLogic.Common.ReceiptContent.STR_INTRODUCEFRIENDSHEADER);
            myReceiptPrinting.WriteLine(string.Format("Branch : {0}", User.BranchCode));
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine(string.Format("Membership ID : {0}", CurrentMembershipID));
            string strLine = DateTime.Now.ToString("dd/MM/yyyy  hh:mm tt");

            myReceiptPrinting.WriteLine("Rewards Date : " + strLine);
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine(string.Format("Rewards Type : {0}", RewardType));
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine(string.Format("Introducer ID: {0}", IntroMembershipID));
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine(string.Format("Points Earned: {0}", pointEarned));
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("_________________________________________");
            myReceiptPrinting.WriteLine(string.Format("VERIFIED BY  {0}", CurrentMembershipID));
            myReceiptPrinting.Print();
        }
Esempio n. 3
0
        private void PrintIntroReceiptServices(string CurrentMembershipID, string IntroMembershipID, string strServicesCode)
        {
            // MembershipCurrentMemberName
            ACMSLogic.Printing myReceiptPrinting = new ACMSLogic.Printing();
            myReceiptPrinting.WriteLine(ACMSLogic.Common.ReceiptContent.STR_COMPANY_NAME);
            myReceiptPrinting.WriteLine(ACMSLogic.Common.ReceiptContent.STR_INTRODUCEFRIENDSHEADER);
            myReceiptPrinting.WriteLine(string.Format("Branch : {0}", User.BranchCode));
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine(string.Format("Membership ID : {0}", CurrentMembershipID));
            string strLine = DateTime.Now.ToString("dd/MM/yyyy  hh:mm tt");
            myReceiptPrinting.WriteLine("Rewards Date : " + strLine);
            myReceiptPrinting.WriteLine("");

            myReceiptPrinting.WriteLine(string.Format("Free Treatment : {0}", strServicesCode));
            myReceiptPrinting.WriteLine(string.Format("Introducer ID: {0}", IntroMembershipID));
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("");
            myReceiptPrinting.WriteLine("_________________________________________");
            myReceiptPrinting.WriteLine(string.Format("VERIFIED BY  {0}", CurrentMembershipID));
            myReceiptPrinting.Print();
        }
Esempio n. 4
0
 private void PrintIntroReceipt(string CurrentMembershipID, string IntroMembershipID, DataTable FreebieCode)
 {
     // MembershipCurrentMemberName
     ACMSLogic.Printing myReceiptPrinting = new  ACMSLogic.Printing();
     myReceiptPrinting.WriteLine(ACMSLogic.Common.ReceiptContent.STR_COMPANY_NAME);
     myReceiptPrinting.WriteLine(ACMSLogic.Common.ReceiptContent.STR_INTRODUCEFRIENDSHEADER);
     myReceiptPrinting.WriteLine(string.Format("Branch : {0}", User.BranchCode));
     myReceiptPrinting.WriteLine("");
     myReceiptPrinting.WriteLine(string.Format("Membership ID : {0}", CurrentMembershipID));
     string strLine = DateTime.Now.ToString("dd/MM/yyyy  hh:mm tt");
     myReceiptPrinting.WriteLine("Rewards Date : " + strLine);
     myReceiptPrinting.WriteLine("");
     for( int i = 0; i<FreebieCode.Rows.Count;i++)
     {
         myReceiptPrinting.WriteLine(string.Format("Free Gift : {0}", FreebieCode.Rows[i]["strDescription"].ToString()));
         myReceiptPrinting.WriteLine("");
     }
     myReceiptPrinting.WriteLine(string.Format("Introducer ID: {0}", IntroMembershipID));
     //			myReceiptPrinting.WriteLine("");
     //			myReceiptPrinting.WriteLine(string.Format("Points Earned: {0}", pointEarned));
     myReceiptPrinting.WriteLine("");
     myReceiptPrinting.WriteLine("");
     myReceiptPrinting.WriteLine("");
     myReceiptPrinting.WriteLine("");
     myReceiptPrinting.WriteLine("_________________________________________");
     myReceiptPrinting.WriteLine(string.Format("VERIFIED BY  {0}", CurrentMembershipID));
     myReceiptPrinting.Print();
 }
Esempio n. 5
0
        public void PrintClassAttendanceReminder(int nPackageID, string strMembershipID, int nClassInstanceID)
        {
            TblCompany comp = new TblCompany();
            DataTable compTable = comp.SelectAll();

            int nClassLeft = 0;
            int nDaysToExpire = 0;

            if (compTable != null && compTable.Rows.Count > 0)
            {
                nClassLeft = ACMS.Convert.ToInt32(compTable.Rows[0]["nClassLeft"]);
                nDaysToExpire = ACMS.Convert.ToInt32(compTable.Rows[0]["nDaysToExpire"]);
            }

            TblMemberPackage sqlMemberPackage = new TblMemberPackage();
            DataTable memberPackageTable = sqlMemberPackage.GetMemberPackage(nPackageID);

            ACMSLogic.MemberPackage.CalculateMemberPackageBalance(memberPackageTable.Rows[0]["strPackageCode"].ToString(),strMembershipID, memberPackageTable);

            DateTime expiryDate = ACMS.Convert.ToDateTime(memberPackageTable.Rows[0]["dtExpiryDate"]);

            TblMember member = new TblMember();
            DataTable memberTable = member.LoadData("Select dtDOB, strMemberName from tblMember Where strMembershipID = @strMembershipID",
                new string[] {"@strMembershipID"}, new object[] {strMembershipID});

            ACMSLogic.Printing myReceiptPrinting = new Printing();
            myReceiptPrinting.WriteLine(string.Format("Branch : {0} {1}", User.BranchCode,
                DateTime.Now.ToString("dd/MM/yyyy  hh:mm tt")));
            myReceiptPrinting.WriteLine(string.Format("Membership ID : {0}", strMembershipID));
            myReceiptPrinting.WriteLine(string.Format("Member Name : {0}", memberTable.Rows[0]["strMemberName"].ToString()));
            myReceiptPrinting.WriteLine("");

            if (memberPackageTable.Rows[0]["strPackageCode"].ToString() == "Unlinked")
            {

                myReceiptPrinting.WriteLine("No Valid Fitness Package.");
                //DataTable packageTable = sqlMemberPackage.LoadData("select mListPrice from tblPackage Where strDescription = 'Trial Gym'");
                //myReceiptPrinting.WriteLine("No Valid Fitness Package.");
                myReceiptPrinting.Print();
                return;
            }

            bool bClassPrint ;

            bClassPrint=false;

            if (memberPackageTable.Rows[0]["dtStartDate"] != DBNull.Value)
                myReceiptPrinting.WriteLine(string.Format("Package Start On : {0}",
                    ACMS.Convert.ToDateTime(memberPackageTable.Rows[0]["dtStartDate"]).ToString("dd/MM/yyyy")));

            if (memberPackageTable.Rows[0]["dtExpiryDate"] != DBNull.Value)
                myReceiptPrinting.WriteLine(string.Format("Package Expiry Date : {0}",
                    ACMS.Convert.ToDateTime(memberPackageTable.Rows[0]["dtExpiryDate"]).ToString("dd/MM/yyyy")));

            if (DateTime.Compare(ACMS.Convert.ToDBDateTime(memberPackageTable.Rows[0]["dtStartDate"]),DateTime.Today.Date)==0)
                //if (memberPackageTable.Rows[0]["dtExpiryDate"] == DBNull.Value)
            {
                TblClassAttendance classAttendance = new TblClassAttendance();
                classAttendance.NPackageID = nPackageID;
                int totalClassAttend = classAttendance.SelectAllWnPackageIDLogic().Rows.Count;
                if (totalClassAttend == 1)
                {
                    myReceiptPrinting.WriteLine("Package Has Been Activated.");
                    bClassPrint = true;
                }
            }

            //Print Day To Expiry
            System.TimeSpan timeSpan = expiryDate.Date.Subtract(DateTime.Today.Date);
            if (timeSpan.Days <= nDaysToExpire)
            {
                myReceiptPrinting.WriteLine(string.Format("Days To Expiry : {0}", timeSpan.Days));
                bClassPrint = true;
            }

            //Print Member Package Balance
            int balance = ACMS.Convert.ToInt32(memberPackageTable.Rows[0]["Balance"]);
            if (balance <= nClassLeft)
            {
                myReceiptPrinting.WriteLine(string.Format("Balance Visit : {0} ", balance));
                bClassPrint = true;
            }

            // Check Member Outstanding Receipt
            TblReceipt receipt = new TblReceipt();
            Decimal mTotalOutstanding = 0;
            object obj= receipt.GetOutStandingBalance(strMembershipID);

            if (obj != null)
            {
                mTotalOutstanding = (decimal)obj;
                mTotalOutstanding = decimal.Round(mTotalOutstanding, 2);
            }

            if (mTotalOutstanding > 0)
            {
                myReceiptPrinting.WriteLine("Outstanding Cash Bill Check.");
                bClassPrint = true;
            }

            if (memberPackageTable.Rows[0]["strRemarks"].ToString().Length > 0)
            {
                myReceiptPrinting.WriteLine("Refer To Member Package's Remark.");
                bClassPrint = true;
            }

            if (ACMS.Convert.ToDateTime(memberTable.Rows[0]["DtDOB"]).Date == DateTime.Today.Date)
            {
                myReceiptPrinting.WriteLine("");
                myReceiptPrinting.WriteLine(string.Format("Happy Birthday To {0}.",
                    memberTable.Rows[0]["strMemberName"].ToString()));
                bClassPrint = true;
            }

            //	myReceiptPrinting.Close;
            if (bClassPrint == true)
            {
                myReceiptPrinting.Print();
            }
            else myReceiptPrinting.DelFile();
        }