Beispiel #1
0
        public override void Refresh()
        {
            string cmdtext = "";

            ACMSDAL.TblPromotion promotion1 = new ACMSDAL.TblPromotion();
            myDataTable1 = promotion1.LoadData("select dtdate from tblreceipt where strreceiptNo = @strReceipt",
                new string[] { "@strReceipt" },
                new object[] { myReceipt });
            dtDate = DateTime.Now;
            if (myDataTable1.Rows.Count > 0)
                dtDate = System.Convert.ToDateTime(myDataTable1.Rows[0][0]);

            //if (myIsMember)
            //{
            cmdtext = " Select distinct A.* from tblPromotion A, tblMember B, tblLoyaltyStatus C, tblPromotionBranch D, tblPromotionReceiptSalesCategory E " +
                " where A.FItemDiscount = 0 AND " +
                " A.mMinimumAmount <= @ReceiptAmount And A.nApprovedStatusID = 1 AND " +
                " ( A.nPromotionTypeID = 1 or A.nPromotionTypeID = 2) AND " +
                " A.dtValidStart <= @Date AND CONVERT(VARCHAR(10),A.dtValidEnd,102)+' 23:59:59' >= @Date AND " +
                " ((A.nDiscountCategoryID = C.nDiscountCategoryID AND B.nLoyaltyStatusID = C.nLoyaltyStatusID) or A.nDiscountCategoryID =0) AND" +
                " D.strPromotionCode = A.strPromotionCode and D.strBranchCode = @strBranchCode AND E.strPromotionCode = A.strPromotionCode AND " +
                " B.StrMembershipID = @ID AND E.nSalesCategoryID = @nSalesCategoryID";
            //}
            ACMSDAL.TblPromotion promotion = new ACMSDAL.TblPromotion();
            myDataTable = promotion.LoadData(cmdtext, new string[] {"@ReceiptAmount", "@Date", "@strBranchCode", "@ID" , "@nSalesCategoryID"},
                new object[] { myReceiptAmt, dtDate, myBranchCode, myID, mySalesCategoryID });

            Init();
        }
Beispiel #2
0
        public override void Refresh()
        {
            string cmdtext = "";
            //if (myIsMember)
            //{
            cmdtext = " Select distinct A.* from tblPromotion A, tblMember B, tblLoyaltyStatus C, tblPromotionBranch D, tblPromotionReceiptSalesCategory E " +
                " where A.FItemDiscount = 0 AND " +
                " A.mMinimumAmount <= @ReceiptAmount And A.nApprovedStatusID = 1 AND " +
                " (A.nPromotionTypeID = 0) AND " +
                " A.dtValidStart <= @Date AND A.dtValidEnd >= @Date AND " +
                " ((A.nDiscountCategoryID = C.nDiscountCategoryID AND B.nLoyaltyStatusID = C.nLoyaltyStatusID) or A.nDiscountCategoryID =0) AND" +
                " D.strPromotionCode = A.strPromotionCode and D.strBranchCode = @strBranchCode AND E.strPromotionCode = A.strPromotionCode AND " +
                " B.StrMembershipID = @ID AND E.nSalesCategoryID = @nSalesCategoryID";
            //}
            ACMSDAL.TblPromotion promotion = new ACMSDAL.TblPromotion();
            myDataTable = promotion.LoadData(cmdtext, new string[] {"@ReceiptAmount", "@Date", "@strBranchCode", "@ID", "@nSalesCategoryID"},
                new object[]{myReceiptAmt, DateTime.Now.Date, myBranchCode, myID, mySalesCategoryID});

            Init();
        }
Beispiel #3
0
        public override void Refresh()
        {
            string cmdtext = "";

            ACMSDAL.TblPromotion promotion1 = new ACMSDAL.TblPromotion();
            myDataTable1 = promotion1.LoadData("select dtdate from tblreceipt where strreceiptNo = @strReceipt",
                new string[] { "@strReceipt"},
                new object[] { myReceipt });
            dtDate = DateTime.Now;
            if (myDataTable1.Rows.Count > 0)
                dtDate = System.Convert.ToDateTime(myDataTable1.Rows[0][0]);
            if (!myIsStaffPurchase)//1105
            {
                cmdtext = " Select distinct A.* from tblPromotion A, tblEmployee B, tblJobPosition C, tblPromotionBranch D, tblMember E where A.FItemDiscount = 1 AND " +
                        " A.mMinimumAmount <= @ReceiptAmount And A.nApprovedStatusID = 1 AND " +
                        " (A.nPromotionTypeID = 1 or A.nPromotionTypeID = 2) AND " +
                        " A.dtValidStart <= cast(@Date as varchar(11)) AND A.dtValidEnd >= cast(@Date as varchar(11)) AND " +
                        " ((A.nDiscountCategoryID = C.nDiscountCategoryID AND B.strJobPositionCode = C.strJobPositionCode) or A.nDiscountCategoryID =0) AND " +
                        " D.strPromotionCode = A.strPromotionCode and D.strBranchCode = @strBranchCode AND " +
                        " E.StrMembershipID = @ID AND A.strPromotionCode in " +
                        " ( Select strPromotionCode from tblItemPromotion where " +
                        " (nCategoryTypeID = @nCategoryTypeID and nGroupID = 0 and strCode = @strCodeInTblItemPromotionToMatch) " +
                        " or (nCategoryTypeID = @nCategoryTypeID and nGroupID = 1 and strCode = @strCodeInTblItemPromotionToMatch))";

            }

            else
            {
                cmdtext = " Select distinct A.* from tblPromotion A, tblEmployee B, tblJobPosition C, tblPromotionBranch D, tblMember E where A.FItemDiscount = 1 AND " +
                    " A.mMinimumAmount <= @ReceiptAmount And A.nApprovedStatusID = 1 AND " +
                    " (A.nPromotionTypeID = 1 or A.nPromotionTypeID = 2) AND " +
                    " A.dtValidStart <= cast(@Date as varchar(11)) AND A.dtValidEnd >= cast(@Date as varchar(11)) AND " +
                    " ((A.nDiscountCategoryID = C.nDiscountCategoryID AND B.strJobPositionCode = C.strJobPositionCode) or A.nDiscountCategoryID =0) AND " +
                    " D.strPromotionCode = A.strPromotionCode and D.strBranchCode = @strBranchCode AND B.nEmployeeID = E.nMembershipNo AND " +
                    " E.StrMembershipID = @ID AND A.strPromotionCode in " +
                    " ( Select strPromotionCode from tblItemPromotion where " +
                    " (nCategoryTypeID = @nCategoryTypeID and nGroupID = 0 and strCode = @strCodeInTblItemPromotionToMatch) " +
                    " or (nCategoryTypeID = @nCategoryTypeID and nGroupID = 1 and strCode = @strCodeInTblItemPromotionToMatch))";
            }

            ACMSDAL.TblPromotion promotion = new ACMSDAL.TblPromotion();
            myDataTable = promotion.LoadData(cmdtext,
                new string[] {"@ReceiptAmount", "@Date", "@strBranchCode", "@ID", "@nCategoryTypeID", "@strCodeInTblItemPromotionToMatch", "@nCategoryID"},
                new object[] { myReceiptAmt, dtDate, myBranchCode, myID, myCategoryTypeID, myStrCodeInTblItemPromotionToMatch, myCategoryID });

            Init();
        }
Beispiel #4
0
 public override void Refresh()
 {
     ACMSDAL.TblPromotion sqlPromotion = new ACMSDAL.TblPromotion();
     myDataTable = sqlPromotion.GetPromotionForMemberPackage(myStrBranchCode);
     Init();
 }
Beispiel #5
0
        public override void Refresh()
        {
            string cmdtext = "";
            if (!myIsStaffPurchase)
            {
                    cmdtext = " Select distinct A.* from tblPromotion A, tblMember B, tblLoyaltyStatus C, tblPromotionBranch D where A.FItemDiscount = 1 AND " +
                    "  A.strPromotionCode <>'090018SPD' AND A.mMinimumAmount <= @ReceiptAmount And A.nApprovedStatusID = 1 AND " +
                    " (A.nPromotionTypeID = 0) AND " +
                    " A.dtValidStart <= @Date AND A.dtValidEnd >= @Date AND " +
                    " ((A.nDiscountCategoryID = C.nDiscountCategoryID AND B.nLoyaltyStatusID = C.nLoyaltyStatusID) or A.nDiscountCategoryID = 0) AND" +
                    " D.strPromotionCode = A.strPromotionCode and D.strBranchCode = @strBranchCode AND " +
                    " B.StrMembershipID = @ID AND A.strPromotionCode in " +
                    " ( Select strPromotionCode from tblItemPromotion where " +
                    " (nCategoryTypeID = @nCategoryTypeID and nGroupID = 0 and strCode = @strCodeInTblItemPromotionToMatch) " +
                    " or (nCategoryTypeID = @nCategoryTypeID and nGroupID = 1 and strCode = '@nCategoryID'))" +
                    " union Select distinct A.* from tblPromotion A, tblMember B, tblLoyaltyStatus C where A.FItemDiscount = 1 AND " + //1105 newly add jackie
                    " A.mMinimumAmount <= @ReceiptAmount And A.nApprovedStatusID = 1 AND " +
                    " (A.nPromotionTypeID = 0) AND  ((A.nDiscountCategoryID = C.nDiscountCategoryID AND B.nLoyaltyStatusID = C.nLoyaltyStatusID) or A.nDiscountCategoryID = 0) AND " +
                    " strPromotionCode='090018SPD' and @nCategoryID =12 AND B.StrMembershipID = @ID and month(B.dtDOB) =month(GETDATE()) ";
            }
            else
            {
                cmdtext = " Select distinct A.* from tblPromotion A, tblEmployee B, tblJobPosition C, tblPromotionBranch D, tblMember E where A.FItemDiscount = 1 AND " +
                    " A.mMinimumAmount <= @ReceiptAmount And A.nApprovedStatusID = 1 AND " +
                    " (A.nPromotionTypeID = 0) AND " +
                    " A.dtValidStart <= @Date AND A.dtValidEnd >= @Date AND " +
                    " ((A.nDiscountCategoryID = C.nDiscountCategoryID AND B.strJobPositionCode = C.strJobPositionCode) or A.nDiscountCategoryID =0) AND " +
                    " D.strPromotionCode = A.strPromotionCode and D.strBranchCode = @strBranchCode AND B.nEmployeeID = E.nMembershipNo AND " +
                    " E.StrMembershipID = @ID AND A.strPromotionCode in " +
                    " ( Select strPromotionCode from tblItemPromotion where " +
                    " (nCategoryTypeID = @nCategoryTypeID and nGroupID = 0 and strCode = @strCodeInTblItemPromotionToMatch) " +
                    " or (nCategoryTypeID = @nCategoryTypeID and nGroupID = 1 and strCode = '@nCategoryID'))";
            }

            ACMSDAL.TblPromotion promotion = new ACMSDAL.TblPromotion();
            myDataTable = promotion.LoadData(cmdtext, new string[] {"@ReceiptAmount", "@Date", "@strBranchCode", "@ID", "@nCategoryTypeID", "@strCodeInTblItemPromotionToMatch", "@nCategoryID"},
                new object[]{myReceiptAmt, DateTime.Now.Date, myBranchCode, myID, myCategoryTypeID, myStrCodeInTblItemPromotionToMatch, myCategoryID});

            Init();
        }