public DealWizzard(string externalDealId="",string externalDealName="", Partner_site partner=null, int productsPrice=-1)
 {
     InitializeComponent();
     newDeal = new Deal();
     _prodInDeal = new List<Product_in_deal>();
     cb_partner.ItemsSource = Databases.localModel.Partner_siteSet.ToList();
     _products = Databases.localModel.ProductSet.ToList();
     cb_product.ItemsSource = _products;
     _shippingPrices = new List<Shipping_price>();
     shippingPrices_datagrid.ItemsSource = _shippingPrices;
     wizz.Finished += wizz_Finished;
     tb_externalId.Text = externalDealId;
     tb_name.Text = externalDealName;
     cb_priority.ItemsSource = Enum.GetValues(typeof(OrderPriority));
     cb_priority.SelectedItem = Enum.Parse(typeof(OrderPriority), "Normál");
     if(partner!=null)
     {
         cb_partner.SelectedItem = partner;
         cb_partner.IsEnabled = false;
     }
     if(productsPrice!=-1)
     {
         lbl_needToBe.Content = "Várt érték: "+productsPrice + " Ft.";
         lbl_needToBe.Visibility = System.Windows.Visibility.Visible;
     }
 }
 private void cb_partner_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     selectedPartner = (Partner_site)cb_partner.SelectedItem;
     cb_deal.ItemsSource = Databases.localModel.DealSet.Where(x => x.Partner_site.Name == selectedPartner.Name).ToList();
     populatePaymentModes();
     populateShippingModes();
     Validate();
 }
Beispiel #3
0
 public DealSelectUserTask(string externalDealId, string externalDealName, Partner_site partner, int productsPrice=-1)
     : base()
 {
     this.ExternalDealName = externalDealName;
     this.partner = partner;
     this.ProductsPrice = productsPrice;
     this.ExternalDealId = externalDealId;
     this.Message = "Ismeretlen ajánlat: "+ partner.Name+" - \""+ExternalDealName+"\"";
 }
Beispiel #4
0
        /// <summary>
        /// Initializing database whit default values for the first time use
        /// </summary>
        /// <returns>Success of initialization</returns>
        public static bool FirstTimeInit()
        {
            //Creating administrator user group whit all rights enabled
            User_group adminGroup = new User_group();
            adminGroup.Name = "Administrator Group";
            adminGroup.Can_create_deal = true;
            adminGroup.Can_create_order = true;
            adminGroup.Can_create_partner = true;
            adminGroup.Can_create_product = true;
            adminGroup.Can_create_user = true;
            adminGroup.Can_modify_deal = true;
            adminGroup.Can_modify_global_settings = true;
            adminGroup.Can_modify_order = true;
            adminGroup.Can_modify_partner = true;
            adminGroup.Can_modify_product = true;
            adminGroup.Can_modify_rights = true;
            adminGroup.Can_modify_user = true;

            //Creating administrator user with un.: admin pw.: admin
            User adminUser = new User();
            adminUser.Name = "ADMIN";
            adminUser.Password = Globals.GetpasswordHash("admin");
            adminUser.Username = "******";
            adminUser.Change_password_immediatly = true;

            adminUser.User_groups.Add(adminGroup);
            serverModel.UserSet.Add(adminUser);

            User agent = new User();
            agent.Username = "******";
            agent.Password = Globals.GetpasswordHash("AGENT");
            agent.Name = "AGENT";
            agent.Change_password_immediatly = false;
            agent.User_groups.Add(adminGroup);
            serverModel.UserSet.Add(agent);

            //Creating default payment modes
            serverModel.Payment_modeSet.Add(new Payment_mode { Name = "Előre utalás" });
            serverModel.Payment_modeSet.Add(new Payment_mode { Name = "Utánvét" });

            //Creating default shipping modes
            serverModel.Shipping_modeSet.Add(new Shipping_mode { Name = "Postai csomag" });
            serverModel.Shipping_modeSet.Add(new Shipping_mode { Name = "Futárszolgálat" });
            serverModel.Shipping_modeSet.Add(new Shipping_mode { Name = "Személyes átvétel" });

            //Creating default Partner sites
            Partner_site Grando = new Partner_site { Name = "Grando", Code = "GRANDO", Default_shipping_price = 800, Auto_sync = true };
            serverModel.Partner_siteSet.Add(Grando);
            Partner_site Deal24 = new Partner_site { Name = "Deal24", Code = "D24", Default_shipping_price = 800, Auto_sync = true };
            serverModel.Partner_siteSet.Add(Deal24);
            Partner_site Gruppi = new Partner_site { Name = "Gruppi", Code = "GRUPPI", Default_shipping_price = 800, Auto_sync = true };
            serverModel.Partner_siteSet.Add(Gruppi);

            serverModel.Payment_associationSet.Add(new Payment_association { Partner_siteName = "Grando", Payment_modeName = "Előre utalás", External_value = "1" });
            serverModel.Payment_associationSet.Add(new Payment_association { Partner_siteName = "Grando", Payment_modeName = "Utánvét", External_value = "2" });
            serverModel.Payment_associationSet.Add(new Payment_association { Partner_siteName = "Deal24", Payment_modeName = "Előre utalás", External_value = "bank" });
            serverModel.Payment_associationSet.Add(new Payment_association { Partner_siteName = "Deal24", Payment_modeName = "Utánvét", External_value = "transfer" });
            serverModel.Payment_associationSet.Add(new Payment_association { Partner_siteName = "Gruppi", Payment_modeName = "Előre utalás", External_value = "Banki átutalás" });
            serverModel.Payment_associationSet.Add(new Payment_association { Partner_siteName = "Gruppi", Payment_modeName = "Utánvét", External_value = "Készpénz" });

            serverModel.Shipping_associationSet.Add(new Shipping_association { Partner_siteName = "Grando", Shipping_modeName = "Postai csomag", External_value = "1" });
            serverModel.Shipping_associationSet.Add(new Shipping_association { Partner_siteName = "Grando", Shipping_modeName = "Futárszolgálat", External_value = "4" });
            serverModel.Shipping_associationSet.Add(new Shipping_association { Partner_siteName = "Grando", Shipping_modeName = "Személyes átvétel", External_value = "8" });
            serverModel.Shipping_associationSet.Add(new Shipping_association { Partner_siteName = "Deal24", Shipping_modeName = "Futárszolgálat", External_value = "Futárszolgálat" });
            serverModel.Shipping_associationSet.Add(new Shipping_association { Partner_siteName = "Gruppi", Shipping_modeName = "Futárszolgálat", External_value = "Házhoz szállítás" });

            //Creating default system statuses
            serverModel.System_order_statusSet.Add(new System_order_status { Name = "Feldolgozás alatt" });
            serverModel.System_order_statusSet.Add(new System_order_status { Name = "Feladva" });
            serverModel.System_order_statusSet.Add(new System_order_status { Name = "Nem utalt" });
            serverModel.System_order_statusSet.Add(new System_order_status { Name = "Törölve" });
            serverModel.System_order_statusSet.Add(new System_order_status { Name = "Átvette" });
            serverModel.System_order_statusSet.Add(new System_order_status { Name = "Nem vette át" });

            //Creating default partner order status
            serverModel.Order_statusSet.Add(new Order_status { Partner_siteName = "Grando", System_order_statusName = "Feladva", Name = "Feladva", Code = "1" });
            serverModel.Order_statusSet.Add(new Order_status { Partner_siteName = "Grando", System_order_statusName = "Nem utalt", Name = "Nem utalt", Code = "4" });
            serverModel.Order_statusSet.Add(new Order_status { Partner_siteName = "Grando", System_order_statusName = "Törölve", Name = "Nem teljesíthető", Code = "3" });
            serverModel.Order_statusSet.Add(new Order_status { Partner_siteName = "Grando", System_order_statusName = "Átvette", Name = "Átvette", Code = "6" });
            serverModel.Order_statusSet.Add(new Order_status { Partner_siteName = "Grando", System_order_statusName = "Nem vette át", Name = "Nem vette át", Code = "7" });

            serverModel.RegistrySet.Add(new Registry { Name = "bill_user", Value = "teszt15" });
            serverModel.RegistrySet.Add(new Registry { Name = "bill_pass", Value = "teszt15" });
            serverModel.RegistrySet.Add(new Registry { Name = "ship_user", Value = "Electroinvets2" });
            serverModel.RegistrySet.Add(new Registry { Name = "ship_pass", Value = "gaAR50RGrtiL" });
            serverModel.RegistrySet.Add(new Registry { Name = "ship_user_id", Value = "174" });

            serverModel.SaveChanges();
            return true;
        }