Beispiel #1
0
        public void CheckBizRuleEngineForPhysicalProductWithCommission()
        {
            Dictionary <ServiceKey, IService> services =
                new Dictionary <ServiceKey, IService>();
            ShippingPackagingSlip packagingSlip =
                new ShippingPackagingSlip();

            ShippingPackagingSlipData shippingPackagingSlipData =
                new ShippingPackagingSlipData();

            shippingPackagingSlipData.Price      = 100;
            shippingPackagingSlipData.SlipNumber = Guid.NewGuid();

            packagingSlip.data = shippingPackagingSlipData;


            CommissionService commissionService =
                new CommissionService();

            CommissionData commissionData
                = new CommissionData();

            commissionData.Commission = 100;
            commissionData.SlipNumber = Guid.NewGuid();


            commissionService.data = commissionData;

            services.Add(ServiceKey.commission, commissionService);

            services.Add(ServiceKey.shippingpackingslip, packagingSlip);

            bizRuleEngineRequestHandler.Handle(services);
        }
Beispiel #2
0
        public void CheckBizRuleEngineForBookwithCommission()
        {
            Dictionary <ServiceKey, IService> services =
                new Dictionary <ServiceKey, IService>();
            RoyaltyPackagingSlip packagingSlip =
                new RoyaltyPackagingSlip();

            RoyaltyPackagingSlipData royaltyPackagingSlipData =
                new RoyaltyPackagingSlipData();

            royaltyPackagingSlipData.Price      = 100;
            royaltyPackagingSlipData.SlipNumber = Guid.NewGuid();

            packagingSlip.data = royaltyPackagingSlipData;

            CommissionService commissionService =
                new CommissionService();

            CommissionData commissionData
                = new CommissionData();

            commissionData.Commission = 100;
            commissionData.SlipNumber = Guid.NewGuid();


            commissionService.data = commissionData;

            services.Add(ServiceKey.commission, commissionService);

            services.Add(ServiceKey.royaltypackagingslip, packagingSlip);

            bizRuleEngineRequestHandler.Handle(services);
        }
        public void DeleteCommission(CommissionData e)
        {
            SqlConnection con = new SqlConnection("Data Source=MOHAMED-PC;Initial Catalog=Elections;Integrated Security=True");
            SqlCommand    cmd = new SqlCommand("Delete_Commission", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("ID", e.Id);
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
        }
Beispiel #4
0
        public void CheckBizRuleEngineForCommissionService()
        {
            Dictionary <ServiceKey, IService> services =
                new Dictionary <ServiceKey, IService>();
            CommissionService commissionService =
                new CommissionService();

            CommissionData commissionData
                = new CommissionData();

            commissionData.Commission = 100;
            commissionData.SlipNumber = Guid.NewGuid();


            commissionService.data = commissionData;
            services.Add(ServiceKey.commission, commissionService);

            bizRuleEngineRequestHandler.Handle(services);
        }
        public List <CommissionData> SelectAll_Commission()
        {
            List <CommissionData> clist = new List <CommissionData>();
            SqlConnection         con   = new SqlConnection("Data Source=MOHAMED-PC;Initial Catalog=Elections;Integrated Security=True");
            SqlCommand            cmd   = new SqlCommand("SelectAll_Commission", con);

            cmd.CommandType = CommandType.StoredProcedure;
            con.Open();
            SqlDataReader rdr = cmd.ExecuteReader();

            while (rdr.Read())
            {
                CommissionData e = new CommissionData();
                e.Id          = Convert.ToInt32(rdr["ID"]);
                e.Number      = Convert.ToInt32(rdr["Number"]);
                e.Description = (rdr["Description"]).ToString();
                clist.Add(e);
            }
            con.Close();
            return(clist);
        }