Exemplo n.º 1
0
    /// <summary>
    /// 签约
    /// </summary>
    public void AccountSign()
    {
        ZhongXinInfo entity         = GetZhongXinByID(tools.CheckInt(Request["ID"]));
        ISupplier    mysupplierBll  = SupplierFactory.CreateSupplier();
        SupplierInfo entitySypplier = mysupplierBll.GetSupplierByID(entity.SupplierID, Public.GetUserPrivilege());

        if (entity == null)
        {
            Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }

        string strResult = string.Empty;

        if (sendmessages.AccountSign(entity.CompanyName, ref strResult))
        {
            entity.Register   = 1;
            entity.SubAccount = strResult;
        }
        else
        {
            Public.Msg("error", "错误信息", strResult, false, "{back}");
        }

        if (MyBLL.EditZhongXin(entity))
        {
            //推送短信
            SMS mySMS = new SMS();
            mySMS.Send(entitySypplier.Supplier_Mobile, entity.CompanyName, "zhongxin_info");
            Public.Msg("positive", "操作成功", "操作成功", true, "zhongxin_list.aspx");
        }
        else
        {
            Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }
Exemplo n.º 2
0
 public SupplierViewModel()
 {
     this.supplierRepository = new SupplierRepository();
     this.supplierView       = SupplierFactory.createNew();
     this.userRepository     = new UserRepository();
     selectedUser            = UserFactory.CreateNewUser();
 }
Exemplo n.º 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()));
    }
Exemplo n.º 4
0
 public InitialState(ProcessBooking bookingProc)
     : base(bookingProc.Booking)
 {
     this.bookingProc = bookingProc;
     SupplierFactory factory = new SupplierFactory();
     supplier = factory.GetSupplier(bookingProc.Booking);
 }
Exemplo n.º 5
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();
    }
 public static IList <ISupplierView> GetAllSuppliers()
 {
     return((from c in MerpDatabase().tbl_Sup
             select
             SupplierFactory.createNew(c.Sup_, c.SupNumber, c.SupFirstname, c.SupLastname, c.SupContactname,
                                       c.SupUsr_, c.SupIscompany)).ToList());
 }
Exemplo n.º 7
0
    public ZhongXin()
    {
        //初始化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      = ZhongXinFactory.Create();
        MySupplier = SupplierFactory.CreateSupplier();
        DBHelper   = SQLHelperFactory.CreateSQLHelper();

        pub          = new Public_Class();
        sendmessages = new ZhongXinUtil.SendMessages();

        //Supplier_ID = tools.CheckInt(Session["supplier_id"].ToString());
        //佣金
        CommissionAccNo = System.Configuration.ConfigurationManager.AppSettings["zhongxin_commissionaccno"];
        CommissionAccNm = System.Configuration.ConfigurationManager.AppSettings["zhongxin_commissionaccnm"];
        //交易保证金
        GuaranteeAccNo = System.Configuration.ConfigurationManager.AppSettings["zhongxin_dealguaranteeaccno"];
        GuaranteeAccNm = System.Configuration.ConfigurationManager.AppSettings["zhongxin_dealguaranteeaccnm"];
    }
Exemplo n.º 8
0
        public IngPurchaseOrdersController()
        {
            _factory                = new PurchaseOrderFactory();
            _Supplierfactory        = new SupplierFactory();
            _Storefactory           = new StoreFactory();
            _defaultCurrencyFactory = new DefaultCurrencyFactory();
            _factoryTax             = new Shared.Factory.Settings.TaxFactory();
            //ViewBag.ListStore = GetListStore();
            //lstStore = ViewBag.ListStore;
            //listStoreId = lstStore.Select(x => x.Value).ToList();

            lstStore    = (List <StoreModels>)ViewBag.StoreID.Items;
            listStoreId = lstStore.Select(x => x.Id).ToList();

            //==========
            lstCompany    = GetListCompany();
            listCompanyId = lstCompany.Select(x => x.Value).ToList();

            var lstCurData = _defaultCurrencyFactory.GetListDefaultCurrency();

            foreach (var item in lstCurData)
            {
                lstCur.Add(new SelectListItem
                {
                    Value = item.Id,
                    Text  = item.Symbol
                });
            }
        }
 public static ISupplierView ByPrimaryKey(int primryKey)
 {
     return((from c in MerpDatabase().tbl_Sup
             where c.Sup_ == primryKey
             select
             SupplierFactory.createNew(c.Sup_, c.SupNumber, c.SupFirstname, c.SupLastname, c.SupContactname,
                                       c.SupUsr_, c.SupIscompany)).First());
 }
Exemplo n.º 10
0
 public IngIngredientsController()
 {
     _factory = new IngredientFactory();
     _IngredientUOMFactory      = new IngredientUOMFactory();
     _IngredientSupplierFactory = new IngredientSupplierFactory();
     _SupplierFactory           = new SupplierFactory();
     ViewBag.ListCompany        = GetListCompany();
     //==========
     lstCompany    = ViewBag.ListCompany;
     listCompanyId = lstCompany.Select(x => x.Value).ToList();
 }
Exemplo n.º 11
0
        //Adds a new supplier to the DB-Grace
        public bool AddNewSupplier(int supplierID, string name, string phoneNum, string email, string street, string city, string county, string additionalInfo)
        {
            SupplierList = DataLayer.getAllSuppliers();
            ISupplier supplier;

            DataLayer.AddNewSupplierToDB(supplierID, name, phoneNum, email, street, city, county, additionalInfo);
            supplier = SupplierFactory.GetSupplier(supplierID, name, phoneNum, email, street, city, county, additionalInfo);   // Using a Factory to create the user entity object. ie seperating object creation from business logic
            SupplierList.Add(supplier);
            // Add a reference to the newly created object to the Models UserList
            //Gets the DataLayer to add the new user to the DB.
            return(true);
        }
Exemplo n.º 12
0
        public void GetListSupplierFromCompnay(List <string> ListCompanyId)
        {
            SupplierFactory _SupplierFactory = new SupplierFactory();
            var             dataSupplier     = _SupplierFactory.GetData().Where(x => x.IsActived && ListCompanyId.Contains(x.CompanyId)).ToList();

            foreach (var item in dataSupplier)
            {
                ListSupplier.Add(new SelectListItem
                {
                    Text  = item.Name,
                    Value = item.Id
                });
            }
        }
Exemplo n.º 13
0
 public Boolean addnewSupplier(string SupplierID, string CompanyName, string Email, string Phone, string Street, string City, string County, string Country)
 {
     try
     {
         ISupplier theSupplier = SupplierFactory.GetSupplier(SupplierID, CompanyName, Email, Phone, Street, City, County, Country); // Using a Factory to create the user entity object. ie seperating object creation from business logic
         SupplierList.Add(theSupplier);                                                                                             // Add a reference to the newly created object to the Models UserList
         DataLayer.addNewSupplierToDB(theSupplier);                                                                                 //Gets the DataLayer to add the new user to the DB.
         return(true);
     }
     catch (System.Exception excep)
     {
         return(false);
     }
 }
Exemplo n.º 14
0
    public Feedback()
    {
        //初始化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          = MemberFactory.CreateMember();
        MyFeedback     = FeedBackFactory.CreateFeedBack();
        MySupplier     = SupplierFactory.CreateSupplier();
        MyBidUpRequire = BidUpRequireQuickFactory.CreateBidUpRequireQuick();
    }
Exemplo n.º 15
0
    public ZhongXin()
    {
        //初始化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      = ZhongXinFactory.Create();
        MySupplier = SupplierFactory.CreateSupplier();

        sendmessages = new ZhongXinUtil.SendMessages();
    }
Exemplo n.º 16
0
        static void Main(string[] args)
        {
            System.Console.WriteLine();

            var supplier         = SupplierFactory.GetLegalSupplier("Mario LTD", "Lithuania", true);
            var customer         = CustomerFactory.GetLegalCustomer("Lorum LTD", "Poland", false);
            var requestAgent     = new RequsetRestAgent();
            var vATRequester     = new VATRequester(requestAgent);
            var countryRequester = new EUCountryRequester(requestAgent);
            var euCountryChecker = new EUCountryChecker(countryRequester);
            var invoiceGenerator = new InvoiceGenerator(vATRequester, euCountryChecker);

            var vATPercentage = invoiceGenerator.GenerateInvoiceVAT(supplier, customer);

            System.Console.WriteLine($"Invoice VAT percentage for '{customer.LegalName}' = {vATPercentage}%");
            System.Console.ReadKey();
        }
Exemplo n.º 17
0
        public List <SupplierModels> GetListSuppliers(string storeId)
        {
            List <SupplierModels> lstData = new List <SupplierModels>();

            if (!string.IsNullOrEmpty(storeId))
            {
                var             lstStoreInfo    = (List <StoreModels>)ViewBag.StoreID.Items;
                var             companyId       = lstStoreInfo.Where(ww => ww.Id == storeId).Select(ss => ss.CompanyId).FirstOrDefault();
                SupplierFactory supplierFactory = new SupplierFactory();
                lstData = supplierFactory.GetData(companyId);

                if (lstData != null && lstData.Any())
                {
                    lstData = lstData.OrderBy(oo => oo.Name).ToList();
                }
            }
            return(lstData);
        }
Exemplo n.º 18
0
        public async Task <IHttpActionResult> GetSearchHotel(string hotelId, string date, int days, string supplierName)
        {
            Entity.Hotel hotel = await db.Hotel.FindAsync(hotelId);

            if (hotel == null)
            {
                return(NotFound());
            }

            if (string.IsNullOrEmpty(supplierName))
            {
                return(NotFound());
            }

            var service = new SupplierFactory(supplierName).GetService();
            var result  = await service.GetHotelPrice(hotelId, date, days);

            return(Ok(result));
        }
Exemplo n.º 19
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();
    }
Exemplo n.º 20
0
        public List <POI> Get(string channelID)
        {
            var Result = new List <POI>();

            //面對抽象
            var channel = _ChannelService.Get(channelID);

            //逐一搜尋頻道底下的各類別
            foreach (var category in channel.Categorys)
            {
                //依據該類別所指定的供應商向Repository要資料
                category.Supplier.ForEach(x =>
                {
                    var Repository = SupplierFactory.Generate(x);
                    var POIs       = Repository.Get();
                    Result.AddRange(POIs);
                });
            }

            //並接總合的結果回傳
            return(Result);
        }
        public async Task InitFactories(string url, string account)
        {
            string       baseUrl  = url;
            const string password = "";

            ProductFactory         = new ProductFactory(baseUrl, account, password);
            CategoryFactory        = new CategoryFactory(baseUrl, account, password);
            StockFactory           = new StockAvailableFactory(baseUrl, account, password);
            FeatureValuesFactory   = new ProductFeatureValueFactory(baseUrl, account, password);
            ImageFactory           = new ImageFactory(baseUrl, account, password);
            ProductSupplierFactory = new ProductSupplierFactory(baseUrl, account, password);

            ManufacturerFactory = new ManufacturerFactory(baseUrl, account, password);

            SpecialPriceFactory = new SpecificPriceFactory(baseUrl, account, password);

            var featuresFactory = new ProductFeatureFactory(baseUrl, account, password);
            var features        = await featuresFactory.GetAll();

            //SizeFeature = features.FirstOrDefault(f => f.name.First().Value.Equals("Размер", StringComparison.OrdinalIgnoreCase));
            //ColorFeature = features.FirstOrDefault(f => f.name.First().Value.Equals("Цвет", StringComparison.OrdinalIgnoreCase));

            BatteryFeature = features.FirstOrDefault(f => f.name.First().Value.Equals("Батарейки", StringComparison.OrdinalIgnoreCase));
            if (BatteryFeature == null)
            {
                BatteryFeature = new product_feature()
                {
                    name = new List <language> {
                        new language(1, "Батарейки")
                    }
                };
                BatteryFeature = await featuresFactory.Add(BatteryFeature);
            }

            MaterialFeature = features.FirstOrDefault(f => f.name.First().Value.Equals("Материал", StringComparison.OrdinalIgnoreCase));
            if (MaterialFeature == null)
            {
                MaterialFeature = new product_feature()
                {
                    name = new List <language> {
                        new language(1, "Материал")
                    }
                };
                MaterialFeature = await featuresFactory.Add(MaterialFeature);
            }

            CountryFeature = features.FirstOrDefault(f => f.name.First().Value.Equals("Страна", StringComparison.OrdinalIgnoreCase));
            if (CountryFeature == null)
            {
                CountryFeature = new product_feature()
                {
                    name = new List <language> {
                        new language(1, "Страна")
                    }
                };
                CountryFeature = await featuresFactory.Add(CountryFeature);
            }

            PackingFeature = features.FirstOrDefault(f => f.name.First().Value.Equals("Упаковка", StringComparison.OrdinalIgnoreCase));
            if (PackingFeature == null)
            {
                PackingFeature = new product_feature()
                {
                    name = new List <language> {
                        new language(1, "Упаковка")
                    }
                };
                PackingFeature = await featuresFactory.Add(PackingFeature);
            }

            LengthFeature = features.FirstOrDefault(f => f.name.First().Value.Equals("Длина", StringComparison.OrdinalIgnoreCase));
            if (LengthFeature == null)
            {
                LengthFeature = new product_feature()
                {
                    name = new List <language> {
                        new language(1, "Длина")
                    }
                };
                LengthFeature = await featuresFactory.Add(LengthFeature);
            }

            DiameterFeature = features.FirstOrDefault(f => f.name.First().Value.Equals("Диаметр", StringComparison.OrdinalIgnoreCase));
            if (DiameterFeature == null)
            {
                DiameterFeature = new product_feature()
                {
                    name = new List <language> {
                        new language(1, "Диаметр")
                    }
                };
                DiameterFeature = await featuresFactory.Add(DiameterFeature);
            }

            var optionsFactory = new ProductOptionFactory(baseUrl, account, password);
            var options        = await optionsFactory.GetAll();

            SizeOption = options.FirstOrDefault(f => f.name.First().Value.Equals("size", StringComparison.OrdinalIgnoreCase));
            if (SizeOption == null)
            {
                Log.Error("Size option not found, add size option!");
                throw new Exception("Size option not found");
            }

            ColorOption = options.FirstOrDefault(f => f.name.First().Value.Equals("color", StringComparison.OrdinalIgnoreCase));
            if (ColorOption == null)
            {
                Log.Error("Color option not found, add size option!");
                throw new Exception("Color option not found");
            }

            OptionsValueFactory = new ProductOptionValueFactory(baseUrl, account, password);

            CombinationFactory = new CombinationFactory(baseUrl, account, password);

            SupplierFactory = new SupplierFactory(baseUrl, account, password);
            Suppliers       = await SupplierFactory.GetAll();

            if (!Suppliers.Any())
            {
                throw new Exception("Suppliers not found, add them manualy");
            }
        }
Exemplo n.º 22
0
 public SupplierRepository()
 {
     supplier = SupplierFactory.createNew();
 }
Exemplo n.º 23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="response"></param>
        public static bool Finish(CardOrderSupplierResponse response)
        {
            try
            {
                byte continueSubmit = 0;
                if (response.OrderStatus != 2 && response.Method == 1)
                {
                    var suppInfo = SupplierFactory.GetCacheModel(response.SupplierId);
                    if (suppInfo != null)
                    {
                        if (!string.IsNullOrEmpty(suppInfo.AsynsRetCode))
                        {
                            string[] arr = suppInfo.AsynsRetCode.Split(',');
                            if (arr.Any(s => s == response.SuppErrorCode))
                            {
                                continueSubmit = 1;
                            }
                        }
                    }
                }

                int    seq = 1, continueSupp = 0;
                string cacheKey = "ReceiveSuppResult" + response.SysOrderNo + response.SupplierId.ToString();
                object flag     = HttpRuntime.Cache[cacheKey];
                if (flag == null)
                {
                    DataRow resultRow = dal2.CallbackInsert(response.SysOrderNo
                                                            , response.SupplierId
                                                            , response.OrderStatus
                                                            , response.SuppErrorCode
                                                            , response.SuppErrorMsg
                                                            , continueSubmit);

                    if (resultRow != null)
                    {
                        seq          = Convert.ToInt32(resultRow["seq"]);
                        continueSupp = Convert.ToInt32(resultRow["continueSupp"]);
                    }

                    if (continueSubmit == 1 && continueSupp > 0)
                    {
                    }
                    else
                    {
                        bool processFlag = (seq == 1) || ((seq > 1) && (response.OrderStatus == 2));

                        if (processFlag)
                        {
                            UpdateOrder(seq, response);
                        }
                    }


                    HttpRuntime.Cache.Insert(cacheKey, response.OrderStatus, null, DateTime.Now.AddSeconds(10.0), TimeSpan.Zero);
                }

                if (seq == 1)
                {
                    _notify.DoNotify(response.SysOrderNo);
                }

                Cache.WebCache.GetCacheService().RemoveObject(response.SysOrderNo);

                return(true);
            }
            catch (Exception exception)
            {
                viviLib.ExceptionHandling.ExceptionHandler.HandleException(exception);

                return(false);
            }
        }