Example #1
0
    public Orders()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools           = ToolsFactory.CreateTools();
        encrypt         = EncryptFactory.CreateEncrypt();
        MyOrders        = OrdersFactory.CreateOrders();
        Mylog           = OrdersLogFactory.CreateOrdersLog();
        MyDelivery      = DeliveryWayFactory.CreateDeliveryWay();
        MyPayway        = PayWayFactory.CreatePayWay();
        MyProduct       = ProductFactory.CreateProduct();
        Mypackage       = PackageFactory.CreatePackage();
        Myorderdelivery = OrdersDeliveryFactory.CreateOrdersDelivery();
        MyFavorFee      = PromotionFavorFeeFactory.CreatePromotionFavorFee();
        MyCoupon        = PromotionFavorCouponFactory.CreatePromotionFavorCoupon();
        MyBack          = OrdersBackApplyFactory.CreateOrdersBackApply();
        MyPolicy        = PromotionFavorPolicyFactory.CreatePromotionFavorPolicy();
        MySupplier      = SupplierFactory.CreateSupplier();
        Mydelierytime   = DeliveryTimeFactory.CreateDeliveryTime();
        MyMember        = MemberFactory.CreateMember();
        MyConsumption   = MemberConsumptionFactory.CreateMemberConsumption();
        pageurl         = new PageURL(int.Parse(Application["Static_IsEnable"].ToString()));
        MyAccountLog    = MemberAccountLogFactory.CreateMemberAccountLog();
        MyFavor         = PromotionFavorFactory.CreatePromotionFavor();
        MyCouponRule    = PromotionCouponRuleFactory.CreatePromotionFavorCoupon();
        MyInvoice       = OrdersInvoiceFactory.CreateOrdersInvoice();
    }
Example #2
0
        public void UserfileHandling()
        {
            Orders[] orArr = OrdersFactory.showOrders(uid, usr, orders);
            Console.WriteLine("--------------------------------------------------------------------");
            Console.WriteLine("If you need an Copy of your order type 'Y' or Type 'N' to proceed !");
            Console.WriteLine("--------------------------------------------------------------------");
            char c = Convert.ToChar(Console.ReadLine());

            if (c == 'y')
            {
                bool flag = utilities.FileHandling.UserWriter(uid, orArr, usr);
                if (flag)
                {
                    Console.WriteLine("-------------------------------------------------------");
                    Console.WriteLine("                   SUCCESS !!!                         ");
                    Console.WriteLine("-------------------------------------------------------");
                }
            }
            else
            {
                Console.WriteLine("-------------------------------------------------------");
                Console.WriteLine("                   Thank You !!!                       ");
                Console.WriteLine("-------------------------------------------------------");
            }
        }
Example #3
0
    public Cart()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools         = ToolsFactory.CreateTools();
        encrypt       = EncryptFactory.CreateEncrypt();
        MyOrders      = OrdersFactory.CreateOrders();
        MyCart        = OrdersGoodsTmpFactory.CreateOrdersGoodsTmp();
        MyProduct     = ProductFactory.CreateProduct();
        MyMem         = MemberFactory.CreateMember();
        Mypackage     = PackageFactory.CreatePackage();
        MyAddr        = MemberAddressFactory.CreateMemberAddress();
        MyDelivery    = DeliveryWayFactory.CreateDeliveryWay();
        MyPayway      = PayWayFactory.CreatePayWay();
        Mydelierytime = DeliveryTimeFactory.CreateDeliveryTime();
        MyInvioce     = OrdersInvoiceFactory.CreateOrdersInvoice();
        MyFavorFee    = PromotionFavorFeeFactory.CreatePromotionFavorFee();
        MyCoupon      = PromotionFavorCouponFactory.CreatePromotionFavorCoupon();
        MyPolicy      = PromotionFavorPolicyFactory.CreatePromotionFavorPolicy();
        MyGift        = PromotionFavorGiftFactory.CreatePromotionFavorGift();
        MyCommission  = SupplierCommissionCategoryFactory.CreateSupplierCommissionCategory();
        MySupplier    = SupplierFactory.CreateSupplier();
        MyFavor       = PromotionFavorFactory.CreatePromotionFavor();
        MyLimit       = PromotionLimitFactory.CreatePromotionLimit();
        MyMemberFavor = MemberFavoritesFactory.CreateMemberFavorites();
        pageurl       = new PageURL(int.Parse(Application["Static_IsEnable"].ToString()));
    }
Example #4
0
    public OrdersDelivery()
    {
        //初始化ASP.NET内置对象
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools   = ToolsFactory.CreateTools();
        MyBLL   = OrdersDeliveryFactory.CreateOrdersDelivery();
        Myorder = OrdersFactory.CreateOrders();
    }
Example #5
0
 public void showUserOrderDetails()
 {
     Console.WriteLine("-----------------------------------------------------------------------------------------------------------");
     Console.WriteLine("                                         ORDERS HISTORY DETAILS                                          ");
     Console.WriteLine("-----------------------------------------------------------------------------------------------------------");
     Orders[] orArr = OrdersFactory.showOrders(uid, usr, orders);
     Console.WriteLine("order Id      vendor Id      user Id         Date & Time          Quantity      Total Amount      Status");
     foreach (var o in orArr)
     {
         Console.WriteLine(o.ToString());
     }
     Console.WriteLine("-----------------------------------------------------------------------------------------------------------");
     fileHandling();
     Console.ReadLine();
 }
Example #6
0
    public Credit()
    {
        Response    = System.Web.HttpContext.Current.Response;
        Request     = System.Web.HttpContext.Current.Request;
        Server      = System.Web.HttpContext.Current.Server;
        Session     = System.Web.HttpContext.Current.Session;
        Application = System.Web.HttpContext.Current.Application;

        tools       = ToolsFactory.CreateTools();
        HttpHelper  = HttpHelperFactory.CreateHttpHelper();
        JsonHelper  = JsonHelperFactory.CreateJsonHelper();
        MyLoanApply = OrdersFactory.CreateOrdersLoanApply();

        pub = new Public_Class();

        tradesignkey = System.Web.Configuration.WebConfigurationManager.AppSettings["tradesignkey"].ToString();
        partner_id   = tools.NullStr(Application["CreditPayment_Code"]);
        loan_url     = System.Web.Configuration.WebConfigurationManager.AppSettings["loan-lgs"].ToString();
    }
Example #7
0
    public Contract()
    {
        iaddr              = AddrFactory.CreateAddr();
        Response           = System.Web.HttpContext.Current.Response;
        Request            = System.Web.HttpContext.Current.Request;
        Server             = System.Web.HttpContext.Current.Server;
        Session            = System.Web.HttpContext.Current.Session;
        Application        = System.Web.HttpContext.Current.Application;
        tools              = ToolsFactory.CreateTools();
        addr               = new Addr();
        MyContract         = ContractFactory.CreateContract();
        MyContractTemplate = ContractTemplateFactory.CreateContractTemplate();
        MySupplier         = SupplierFactory.CreateSupplier();
        credit             = new Credit();
        MyOrders           = OrdersFactory.CreateOrders();


        //MyContractSigned = ContractSignedFactory.CreateContractSigned();
    }
Example #8
0
        public void manageOrders()
        {
            Console.WriteLine("-------------------------------------------------------");
            Console.WriteLine("                 Manage Your Orders                    ");
            Console.WriteLine("-------------------------------------------------------");
            showOrderDetails();
            Console.WriteLine("-------------------------------------------------------");
            Console.WriteLine("Enter Your Order ID ");
            int orderId = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("---------------------");
            Console.WriteLine("Enter 'Y' to Accept or 'N' to Cancel Order");
            string orderStatus = Console.ReadLine();
            string msg         = OrdersFactory.updateStatus(orderId, orderStatus, orders);

            Console.WriteLine("---------------------------------------------------------");
            Console.WriteLine(msg);
            Console.WriteLine("---------------------------------------------------------");
            Console.ReadLine();
        }
Example #9
0
        private static void orderFood()
        {
            Program obj = new Program();

            obj.showFoodDetails();
            Console.WriteLine("-------------------------------------------------------");
            Console.WriteLine("Enter the Food ID you want to order...");
            Console.WriteLine("-------------------------------------------------------");
            int fid = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("-------------------------------------------------------");
            Console.WriteLine("Enter the  Food Quantity");
            Console.WriteLine("-------------------------------------------------------");
            int  quantity = Convert.ToInt32(Console.ReadLine());
            bool res      = OrdersFactory.FoodOrder(uid, usr, fid, food, vendor.vendorId, quantity, orders);

            if (res)
            {
                Console.WriteLine("-------------------------------------------------------");
                Console.WriteLine("             Successfully ordered Food");
                Console.WriteLine("-------------------------------------------------------");
            }
            else
            {
                Console.WriteLine("-------------------------------------------------------");
                Console.WriteLine("        Food Order Unsuccessful. Try again.");
                Console.WriteLine("-------------------------------------------------------");
            }
            // Faile handling
            Program p = new Program();

            p.UserfileHandling();
            // mail
            string mailTo = UserFactory.getMail(uid, usr);

            Mail(mailTo);
            Console.WriteLine("---------------------------------------------------------------------");
            Console.WriteLine("     An Invoice of your Order is Mailed to " + mailTo);
            Console.WriteLine("---------------------------------------------------------------------");
            Console.ReadLine();
        }
Example #10
0
        private static void cancelOrder()
        {
            Orders[] ord = OrdersFactory.cancellableOrders(uid, usr, orders);
            Console.WriteLine("-----------------------------------------------------------------------------------------------------------");
            Console.WriteLine("                                         ORDERS HISTORY DETAILS                                          ");
            Console.WriteLine("-----------------------------------------------------------------------------------------------------------");
            Console.WriteLine("order Id      vendor Id      user Id         Date & Time          Quantity      Total Amount      Status");
            foreach (var o in ord)
            {
                Console.WriteLine("\n" + o.ToString());
            }
            Console.WriteLine("----------------------------------------------------------------------------");
            Console.WriteLine("Enter The Order ID you want to cancel... Money will not be refunded..");
            Console.WriteLine("----------------------------------------------------------------------------");
            int  oid = Convert.ToInt32(Console.ReadLine());
            bool res = false;

            try
            {
                res = OrdersFactory.cancelUserOrder(uid, usr, oid, orders);
            }
            catch (UserDefinedException e)
            {
                Console.WriteLine(e.Message);
            }
            if (res)
            {
                Console.WriteLine("-------------------------------------------------------");
                Console.WriteLine("Order has been cancelled successfully..");
                Console.WriteLine("-------------------------------------------------------");
            }
            else
            {
                Console.WriteLine("-------------------------------------------------------");
                Console.WriteLine("Unable to cancel Order. Please check your inputs..");
                Console.WriteLine("-------------------------------------------------------");
            }
            Console.ReadLine();
        }
 public MainWindow()
 {
     InitializeComponent();
     _factory = new OrdersFactory();
 }