public FormAddItemFreebiesAndDiscount(ACMSLogic.POS pos, DataRow row,
                                              int nCategoryTypeID, bool bLoadStockRecon)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
            connection       = new SqlConnection(connectionString);


            if (!myIsFinishLoadStockRecon)
            {
                myIsFinishLoadStockRecon = bLoadStockRecon;
            }
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            myDataRow                    = row;
            myPOS                        = pos;
            myCategoryTypeID             = nCategoryTypeID;
            myStrProduct_Or_Package_Code = myDataRow["strCode"].ToString();
            myPOSEntry                   = new ACMSLogic.POSEntries(myDataRow);

            Init();
            myItemFreebiePromotionCodeLookupBuilder =
                new ACMS.XtraUtils.LookupEditBuilder.ItemFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                                                                                               myPOS.StrMembershipID, myPOS.MNettAmount, myCategoryTypeID, myPOS.NCategoryID,
                                                                                               myStrProduct_Or_Package_Code, myPOS.StrBranchCode, myPOS.IsStaffPurchase, myPOS.StrReceiptNo);

            myItemDiscountPromotionCodeLookupBuilder =
                new ACMS.XtraUtils.LookupEditBuilder.ItemDiscountPromotionCodeLookupEditBuilder(lkpEdtDiscount.Properties,
                                                                                                myPOS.StrMembershipID, myPOS.MNettAmount, myCategoryTypeID, myPOS.NCategoryID,
                                                                                                myStrProduct_Or_Package_Code, myPOS.StrBranchCode, myPOS.IsStaffPurchase);
        }
        public FormAddItemFreebiesAndDiscount(ACMSLogic.POS pos, DataRow row,
                                              int nCategoryTypeID)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            myDataRow                    = row;
            myPOS                        = pos;
            myCategoryTypeID             = nCategoryTypeID;
            myStrProduct_Or_Package_Code = myDataRow["strCode"].ToString();
            myPOSEntry                   = new ACMSLogic.POSEntries(myDataRow);

            Init();
            myItemFreebiePromotionCodeLookupBuilder =
                new ACMS.XtraUtils.LookupEditBuilder.ItemFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                                                                                               myPOS.StrMembershipID, myPOS.MNettAmount, myCategoryTypeID, myPOS.NCategoryID,
                                                                                               myStrProduct_Or_Package_Code, myPOS.StrBranchCode, myPOS.IsStaffPurchase);

            myItemDiscountPromotionCodeLookupBuilder =
                new ACMS.XtraUtils.LookupEditBuilder.ItemDiscountPromotionCodeLookupEditBuilder(lkpEdtDiscount.Properties,
                                                                                                myPOS.StrMembershipID, myPOS.MNettAmount, myCategoryTypeID, myPOS.NCategoryID,
                                                                                                myStrProduct_Or_Package_Code, myPOS.StrBranchCode, myPOS.IsStaffPurchase);
        }
        private void BindDropDownList()
        {
            if (panel == "Adjustment")
            {
                myItemFreebiePromotionCodeLookupBuilder = new ACMS.XtraUtils.LookupEditBuilder.ItemFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                                                                                                                                         this.strMemberShipId, Convert.ToDecimal(this.mTotalAmount), GetCategoryTypeID(Convert.ToInt32(this.nCategoryId)), Convert.ToInt32(this.nCategoryId),
                                                                                                                                         this.strItemCode, this.strBranchCode, IsStaffPurchase(this.strMemberShipId), this.strReceiptNo);
            }
            else
            {
                //				myItemFreebiePromotionCodeLookupBuilder = new ACMS.XtraUtils.LookupEditBuilder.ItemFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                //					this.strMemberShipId, Convert.ToDecimal(this.mTotalAmount), GetCategoryTypeID(Convert.ToInt32(this.nCategoryId)), Convert.ToInt32(this.nCategoryId),
                //					this.strItemCode, this.strBranchCode, IsStaffPurchase(this.strMemberShipId));

                myFreebiePromotionCodeLookupBuilder = new ACMS.XtraUtils.LookupEditBuilder.BillFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                                                                                                                                     this.strMemberShipId, Convert.ToDecimal(this.mTotalAmount), this.strBranchCode, Convert.ToInt32(this.nCategoryId), true, this.strReceiptNo);
            }
            //			ACMSLogic.Promotion.Promotion promotion = new ACMSLogic.Promotion.Promotion();
            //
            //
            //			DataTable dt = promotion.FindPromotionSelectionList(this.terminalUser.Branch.Id,this.mTotalAmount,this.strMemberShipId,this.nCategoryId,this.strBillPromotionCode,panel,this.strReceiptNo,this.strItemCode);
            //			if(dt.Rows.Count==0)
            //				this.simpleButton1.Enabled=false;
            //
            //			this.lkPromotion.Properties.DataSource = dt;
            //
            //
            //			this.lkPromotion.Properties.ValueMember = "strPromotionCode";
            //			this.lkPromotion.Properties.DisplayMember = "strPromotionCode";
            //
            //
            //
            //			//add two columns in the dropdown
            //			LookUpColumnInfoCollection coll = lkPromotion.Properties.Columns;
            //
            //			coll.Add(new LookUpColumnInfo("strPromotionCode","Promotion Code",100));
            //			//a column to display values of the ProductName field
            //			coll.Add(new LookUpColumnInfo("strDescription","Description",300));
            //
            //
            //			//set column widths according to their contents
            //			lkPromotion.Properties.BestFit();
            //			//specify the total dropdown width
            //			lkPromotion.Properties.PopupWidth = 400;
            //
            //
            //			lkPromotion.Properties.AutoSearchColumnIndex = 0;
        }
        private void BindDropDownList()
        {
            if (panel == "Adjustment")
            {
                myItemFreebiePromotionCodeLookupBuilder = new ACMS.XtraUtils.LookupEditBuilder.ItemFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                    this.strMemberShipId, Convert.ToDecimal(this.mTotalAmount), GetCategoryTypeID(Convert.ToInt32(this.nCategoryId)), Convert.ToInt32(this.nCategoryId),
                    this.strItemCode, this.strBranchCode, IsStaffPurchase(this.strMemberShipId), this.strReceiptNo);
            }
            else
            {
                //				myItemFreebiePromotionCodeLookupBuilder = new ACMS.XtraUtils.LookupEditBuilder.ItemFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                //					this.strMemberShipId, Convert.ToDecimal(this.mTotalAmount), GetCategoryTypeID(Convert.ToInt32(this.nCategoryId)), Convert.ToInt32(this.nCategoryId),
                //					this.strItemCode, this.strBranchCode, IsStaffPurchase(this.strMemberShipId));

                myFreebiePromotionCodeLookupBuilder = new ACMS.XtraUtils.LookupEditBuilder.BillFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                    this.strMemberShipId, Convert.ToDecimal(this.mTotalAmount), this.strBranchCode, Convert.ToInt32(this.nCategoryId), true, this.strReceiptNo);
            }
            //			ACMSLogic.Promotion.Promotion promotion = new ACMSLogic.Promotion.Promotion();
            //
            //
            //			DataTable dt = promotion.FindPromotionSelectionList(this.terminalUser.Branch.Id,this.mTotalAmount,this.strMemberShipId,this.nCategoryId,this.strBillPromotionCode,panel,this.strReceiptNo,this.strItemCode);
            //			if(dt.Rows.Count==0)
            //				this.simpleButton1.Enabled=false;
            //
            //			this.lkPromotion.Properties.DataSource = dt;
            //
            //
            //			this.lkPromotion.Properties.ValueMember = "strPromotionCode";
            //			this.lkPromotion.Properties.DisplayMember = "strPromotionCode";
            //
            //
            //
            //			//add two columns in the dropdown
            //			LookUpColumnInfoCollection coll = lkPromotion.Properties.Columns;
            //
            //			coll.Add(new LookUpColumnInfo("strPromotionCode","Promotion Code",100));
            //			//a column to display values of the ProductName field
            //			coll.Add(new LookUpColumnInfo("strDescription","Description",300));
            //
            //
            //			//set column widths according to their contents
            //			lkPromotion.Properties.BestFit();
            //			//specify the total dropdown width
            //			lkPromotion.Properties.PopupWidth = 400;
            //
            //
            //			lkPromotion.Properties.AutoSearchColumnIndex = 0;
        }
        public FormAddItemFreebiesAndDiscount(ACMSLogic.POS pos, DataRow row, 
			int nCategoryTypeID,bool bLoadStockRecon)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
            connection = new SqlConnection(connectionString);

            if (!myIsFinishLoadStockRecon)
            {
                myIsFinishLoadStockRecon = bLoadStockRecon;
            }
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            myDataRow = row;
            myPOS = pos;
            myCategoryTypeID = nCategoryTypeID;
            myStrProduct_Or_Package_Code = myDataRow["strCode"].ToString();
            myPOSEntry = new ACMSLogic.POSEntries(myDataRow);

            Init();
            myItemFreebiePromotionCodeLookupBuilder =
                new ACMS.XtraUtils.LookupEditBuilder.ItemFreebiePromotionCodeLookupEditBuilder(lkpEdtItemFreebiePromotionCode.Properties,
                myPOS.StrMembershipID, myPOS.MNettAmount, myCategoryTypeID, myPOS.NCategoryID,
                myStrProduct_Or_Package_Code, myPOS.StrBranchCode, myPOS.IsStaffPurchase, myPOS.StrReceiptNo);

            myItemDiscountPromotionCodeLookupBuilder =
                new ACMS.XtraUtils.LookupEditBuilder.ItemDiscountPromotionCodeLookupEditBuilder(lkpEdtDiscount.Properties,
                myPOS.StrMembershipID, myPOS.MNettAmount, myCategoryTypeID, myPOS.NCategoryID,
                myStrProduct_Or_Package_Code, myPOS.StrBranchCode, myPOS.IsStaffPurchase);
        }