示例#1
0
        public DataTable GetWaitingListView(int nClassInstanceID)
        {
            TblWaitingList wl = new TblWaitingList();
            DataTable table = wl.GetWaitingListBaseClassInstanceID(nClassInstanceID);
            table.DefaultView.RowFilter = "nStatusID = 0";

            return table.DefaultView.ToTable();
        }
示例#2
0
        public void AddWaitingList(string strMembershipID, int nPackageID, int nClassInstanceID, bool needToVerifyMemberPackage)
        {
            TblClassInstance classInstance = new TblClassInstance();
            classInstance.NClassInstanceID = nClassInstanceID;
            classInstance.SelectOne();

            TblWaitingList wl = new TblWaitingList();

            DateTime classDate = new DateTime(classInstance.DtDate.Value.Year, classInstance.DtDate.Value.Month, classInstance.DtDate.Value.Day,
                classInstance.DtStartTime.Value.Hour, classInstance.DtStartTime.Value.Minute, classInstance.DtStartTime.Value.Second);

            if (DateTime.Today > classDate)
                throw new Exception("You are not allow to add waiting list to the previous day class.");

            if (needToVerifyMemberPackage)
            {
                if (!VerifyMemberPackageAllowCertainClass(nPackageID, classInstance.StrClassCode.Value))
                {
                    DialogResult result = MessageBox.Show("The package you wish to use is not allow to attend the class. Do you still want to proceed. \n " +
                        "(An unlinked record will be create if you click yes) ", "Warning", MessageBoxButtons.YesNo);

                    if (result == DialogResult.Yes)
                    {
                        MemberPackage.CreateUnlinkedMemberPackage(strMembershipID, ref nPackageID);
                    }
                    else
                    {
                        return;
                    }
                }
            }

            //Prompt Package going to expiry
            //Prompt Remaining class

            wl.NClassInstanceID = nClassInstanceID;
            wl.StrMembershipID = strMembershipID;
            wl.DtDate = classInstance.DtDate.Value;
            wl.DtRequestDate = DateTime.Today.Date;
            wl.DtStartTime = classInstance.DtStartTime.Value;
            wl.DtEndTime = classInstance.DtEndTime.Value;
            wl.StrBranchCode = User.BranchCode;
            wl.NStatusID = 0;
            wl.NPackageID = nPackageID;
            wl.StrRemarks = "";
            wl.StrType = "System";
            wl.Insert();
        }
示例#3
0
 public void DeleteWaitingList(int nWaitingListID)
 {
     TblWaitingList wl = new TblWaitingList();
     wl.NWaitingListID = nWaitingListID;
     wl.SelectOne();
     wl.NStatusID = 3;
     wl.Update();
 }
示例#4
0
 public void UpdateWaitingListToTransfered(int nWaitingListID)
 {
     TblWaitingList wl = new TblWaitingList();
     wl.NWaitingListID = nWaitingListID;
     wl.SelectOne();
     wl.NStatusID = 1;
     wl.Update();
 }