private void ProductGeneralView_Load(object sender, EventArgs e)
 {
     LoadView?.Invoke(sender, e);
     Create.Binder(this.vm)
     .Control(txtBx_productName).Property(txtBx => txtBx.Text).Bind(vm => vm.ProductName)
     .Control(txtBx_metatagTitle).Property(txtBx => txtBx.Text).Bind(vm => vm.MetatagTitle)
     .Control(txtBx_metaTagDesc).Property(txtBx => txtBx.Text).Bind(vm => vm.MetatagDescription)
     .Control(txtBx_metaTagKeyWords).Property(txtBx => txtBx.Text).Bind(vm => vm.MetatagKeywords)
     .Control(txtBx_Tags).Property(txtBx => txtBx.Text).Bind(vm => vm.Tags);
     HTMLwysiwyg_description.setHTML(vm.Description);
     HTMLwysiwyg_description.BodyChanged += HTMLwysiwyg_description_BodyChanged;
 }
Пример #2
0
        private async void ProductView_Load(object sender, EventArgs e)
        {
            LoadView?.Invoke(sender, e);
            await Task.Run(() => { while (pictureBox_loading.Enabled)
                                   {
                                       ;
                                   }
                           });

            // General Tab
            BuildDescriptionTabs();
            // Data Tab
            Create.Binder(presenter.DataTabVM)
            .Control(cmbBx_taxclass).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Taxes)
            .Control(cmbBx_lengthClass).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Lengths)
            .Control(cmbBx_weightClass).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Weights)
            .Control(cmbBx_stockStatus).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.StockStatuses)
            .Control(txtBx_mpn).Property(txtbx => txtbx.Text).Bind(vm => vm.MPN)
            .Control(txtBx_sku).Property(txtbx => txtbx.Text).Bind(vm => vm.SKU)
            .Control(txtBx_upc).Property(txtbx => txtbx.Text).Bind(vm => vm.UPC)
            .Control(txtBx_ean).Property(txtbx => txtbx.Text).Bind(vm => vm.EAN)
            .Control(txtBx_jan).Property(txtbx => txtbx.Text).Bind(vm => vm.JAN)
            .Control(txtBx_isbn).Property(txtbx => txtbx.Text).Bind(vm => vm.ISBN)
            .Control(txtBx_model).Property(txtbx => txtbx.Text).Bind(vm => vm.Model)
            .Control(txtBx_location).Property(txtbx => txtbx.Text).Bind(vm => vm.Location)
            .Control(txtBx_price).Property(txtbx => txtbx.Text).Bind(vm => vm.Price)
            .Control(chkBx_status).Property(chkbx => chkbx.Checked).Bind(vm => vm.Status)
            .Control(cmbBx_taxclass).Property(cmbBx => cmbBx.SelectedValue).Bind(vm => vm.TaxClass)
            .Control(materialTextField_quantity).Property(txtbx => txtbx.Text).Bind(vm => vm.Quantity)
            .Control(materialTextField_minQuantity).Property(txtbx => txtbx.Text).Bind(vm => vm.MinimumQuantity)
            .Control(chkBx_subtractStock).Property(chkbx => chkbx.Checked).Bind(vm => vm.SubtractStock)
            .Control(cmbBx_stockStatus).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.StockStatus)
            .Control(txtBx_weight).Property(txtbx => txtbx.Text).Bind(vm => vm.Weight)
            .Control(cmbBx_weightClass).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.WeightClass)
            .Control(materialTextField_Length).Property(txtbx => txtbx.Text).Bind(vm => vm.Length)
            .Control(materialTextField_width).Property(txtbx => txtbx.Text).Bind(vm => vm.Width)
            .Control(cmbBx_lengthClass).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.LengthClass)
            .Control(materialCheckBox_shippingRequired).Property(chkBx => chkBx.Checked).Bind(vm => vm.RequireShipping)
            .Control(dateTimePicker_dateAvailable).Property(dtpkr => dtpkr.Value).Bind(vm => vm.ReleaseDate);
            // Links Tab
            Create.Binder(presenter.LinksTabVM)
            .Control(cmbBx_manufacturer).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Manufacturers)
            .Control(cmbBx_manufacturer).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.Manufacturer);
            ShowLabelsLinkTab();
            // Discount tab
            Create.Binder(presenter.DiscountTabVM)
            .Control(cmbBx_DisGroupCustomer).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.CustomerGroups)
            .Control(cmbBx_DisGroupCustomer).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.Discount.CustomerGroupID)
            .Control(txtBx_discountQuantity).Property(txtbx => txtbx.Text).Bind(vm => vm.Discount.Quantity)
            .Control(txtBx_discountPriority).Property(txtbx => txtbx.Text).Bind(vm => vm.Discount.Priority)
            .Control(txtBx_discountPrice).Property(txtbx => txtbx.Text).Bind(vm => vm.Discount.Price)
            .Control(dateTimePicker_discountDateEnd).Property(date => date.Value).Bind(vm => vm.Discount.DateStart)
            .Control(dateTimePicker_discountDateStart).Property(date => date.Value).Bind(vm => vm.Discount.DateEnd)
            .Control(btn_addDiscount).OnClick(presenter.DiscountTabVM.AddDiscount)
            .Control(lstView_discounts).Property(lv => lv.DataSource).Get(vm => vm.Discounts);
            tsmi_rmDiscount.Click += Tsmi_removeDiscount_Click;
            // Special tab
            Create.Binder(presenter.SpecialTabVM)
            .Control(cmbBx_SpecGroupCustomer).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.CustomerGroups)
            .Control(cmbBx_SpecGroupCustomer).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.SpecialOffer.CustomerGroupID)
            .Control(txtBx_specialPrice).Property(txtbx => txtbx.Text).Bind(vm => vm.SpecialOffer.Price)
            .Control(txtBx_specialPriority).Property(txtbx => txtbx.Text).Bind(vm => vm.SpecialOffer.Priority)
            .Control(dateTimePicker_SpecDateStart).Property(date => date.Value).Bind(vm => vm.SpecialOffer.DateStart)
            .Control(dateTimePicker_SpecDateEnd).Property(date => date.Value).Bind(vm => vm.SpecialOffer.DateEnd)
            .Control(btn_addSpecials).OnClick(presenter.SpecialTabVM.AddSpecialOffer)
            .Control(lstView_specials).Property(lv => lv.DataSource).Get(vm => vm.SpecialOffers);
            tsmi_rmSpecial.Click += Tsmi_rmSpecial_Click;
            // Images Tab
            ImagesTabVM_ShowImages();
            presenter.ImagesTabVM.ImageAdded += ImagesTabVM_ImageAdded;
            Create.Binder(presenter.ImagesTabVM)
            .Control(picBx_image).Property(picBx => picBx.ImageLocation).Bind(vm => vm.ImagePortrait)
            .Control(picBx_image).OnClick(presenter.ImagesTabVM.ChangeImg, openFileDialog_Images)
            .Control(btn_addImages).OnClick(presenter.ImagesTabVM.AddImg, openFileDialog_Images)
            .Control(btn_delImg).OnClick(presenter.ImagesTabVM.RmImg)
            .Target(toolStripMenuItem_suprImage).OnEvent("Click").Execute(presenter.ImagesTabVM.RmAdditionalImg, () =>
            {
                var menu       = toolStripMenuItem_suprImage.Owner as MaterialContextMenuStrip;
                PictureBox pic = menu.SourceControl as PictureBox;
                object img     = pic.Tag;
                flowLayoutPanel_aditionalImages.Controls.Remove(pic);
                pic.Dispose();
                return(img);
            });
            cmbBx_taxclass.ValueMember            = nameof(Tax.ID);
            cmbBx_taxclass.DisplayMember          = nameof(Tax.Title);
            cmbBx_weightClass.ValueMember         = nameof(Weight.ID);
            cmbBx_weightClass.DisplayMember       = nameof(Weight.Title);
            cmbBx_lengthClass.ValueMember         = nameof(Length.ID);
            cmbBx_lengthClass.DisplayMember       = nameof(Length.Title);
            cmbBx_stockStatus.ValueMember         = nameof(StockStatus.ID);
            cmbBx_stockStatus.DisplayMember       = nameof(StockStatus.Name);
            cmbBx_manufacturer.ValueMember        = nameof(Manufacturer.ID);
            cmbBx_manufacturer.DisplayMember      = nameof(Manufacturer.Name);
            cmbBx_SpecGroupCustomer.ValueMember   = nameof(CustomerGroup.ID);
            cmbBx_SpecGroupCustomer.DisplayMember = nameof(CustomerGroup.Name);
            cmbBx_DisGroupCustomer.ValueMember    = nameof(CustomerGroup.ID);
            cmbBx_DisGroupCustomer.DisplayMember  = nameof(CustomerGroup.Name);
        }
Пример #3
0
        private async void OrderView_Load(object sender, EventArgs e)
        {
            LoadView?.Invoke(sender, e);
            await Task.Run(() => { while (pictureBox_loading.Enabled)
                                   {
                                       ;
                                   }
                           });

            Create.Binder(presenter.OrderVM)
            .Control(chkbx_sendMail).Property(chk => chk.Checked).Bind(vm => vm.SendEmail);
            // Customer Tab
            Create.Binder(presenter.CustomerTabVM)
            .Control(txtBx_customers).Property(txtbx => txtbx.AutoCompleteCustomSource).Get(vm => vm.Customers)
            .Control(cmbBx_stores).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Stores)
            .Control(cmbBx_stores).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.Store)
            .Control(cmbBx_currencies).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Currencies)
            .Control(cmbBx_currencies).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.Currency)
            .Control(cmbBx_customerGroups).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.CustomerGroups)
            .Control(cmbBx_customerGroups).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.CustomerGroupID)
            .Control(txtBx_cFirstname).Property(txtbx => txtbx.Text).Bind(vm => vm.Firstname)
            .Control(txtBx_cLastname).Property(txtbx => txtbx.Text).Bind(vm => vm.Lastname)
            .Control(txtBx_cEmail).Property(txtbx => txtbx.Text).Bind(vm => vm.Email)
            .Control(txtBx_cPhone).Property(txtbx => txtbx.Text).Bind(vm => vm.Telephone)
            .Control(btn_addCustomer).OnClick(presenter.CustomerTabVM.AddCustomer);
            cmbBx_stores.DisplayMember         = nameof(Store.Name);
            cmbBx_currencies.DisplayMember     = nameof(Currency.Title);
            cmbBx_customerGroups.ValueMember   = nameof(CustomerGroup.ID);
            cmbBx_customerGroups.DisplayMember = nameof(CustomerGroup.Name);
            // Products Tab
            Create.Binder(presenter.ProductsTabVM)
            .Control(cmbBx_products).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Products)
            .Control(txtBx_quantity).Property(txtbx => txtbx.Text).Bind(vm => vm.Quantity)
            .Control(lstVw_products).Property(lstvw => lstvw.DataSource).Get(vm => vm.OrderProducts)
            .Control(btn_addProduct).OnClick(presenter.ProductsTabVM.AddProduct, () => cmbBx_products.SelectedValue)
            .Target(tsmi_delete).OnEvent("Click").Execute(presenter.ProductsTabVM.RmProduct, () =>
            {
                var menu = tsmi_delete.Owner as MaterialContextMenuStrip;
                MaterialListView listView = menu.SourceControl as MaterialListView;
                if (listView.SelectedIndices.Count > 0)
                {
                    return(listView.SelectedItems[0].Tag);
                }

                return(null);
            });
            // Payment Address Tab
            Create.Binder(presenter.PaymentTabVM)
            .Control(cmbBx_paymentMethods).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.PaymentMethods)
            .Control(cmbBx_paymentMethods).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.PaymentMethod)
            .Control(cmbBx_paAddresses).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Addresses)
            .Control(cmbBx_paAddresses).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.Address)
            .Control(cmbBx_paCountries).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Countries)
            .Control(cmbBx_paCountries).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.CountryID)
            .Control(cmbBx_paZones).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Zones)
            .Control(cmbBx_paZones).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.ZoneID)
            .Control(txtBx_paFirstname).Property(txtbx => txtbx.Text).Bind(vm => vm.Firstname)
            .Control(txtBx_paLastname).Property(txtbx => txtbx.Text).Bind(vm => vm.Lastname)
            .Control(txtBx_paCompany).Property(txtbx => txtbx.Text).Bind(vm => vm.Company)
            .Control(txtBx_paAddress1).Property(txtbx => txtbx.Text).Bind(vm => vm.Address1)
            .Control(txtBx_paAddress2).Property(txtbx => txtbx.Text).Bind(vm => vm.Address2)
            .Control(txtBx_paCity).Property(txtbx => txtbx.Text).Bind(vm => vm.City)
            .Control(txtBx_paPostcode).Property(txtbx => txtbx.Text).Bind(vm => vm.Postcode);
            cmbBx_paCountries.ValueMember   = nameof(Country.ID);
            cmbBx_paCountries.DisplayMember = nameof(Country.Name);
            cmbBx_paZones.ValueMember       = nameof(Zone.ID);
            cmbBx_paZones.DisplayMember     = nameof(Zone.Name);
            // Shipping Address Tab
            Create.Binder(presenter.ShippingTabVM)
            .Control(cmbBx_shippingMethods).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.ShippingMethods)
            .Control(cmbBx_shippingMethods).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.ShippingMethod)
            .Control(cmbBx_saAddresses).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Addresses)
            .Control(cmbBx_saAddresses).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.Address)
            .Control(cmbBx_saCountries).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Countries)
            .Control(cmbBx_saCountries).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.CountryID)
            .Control(cmbBx_saZones).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.Zones)
            .Control(cmbBx_saZones).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.ZoneID)
            .Control(txtBx_saFirstname).Property(txtbx => txtbx.Text).Bind(vm => vm.Firstname)
            .Control(txtBx_saLastname).Property(txtbx => txtbx.Text).Bind(vm => vm.Lastname)
            .Control(txtBx_saCompany).Property(txtbx => txtbx.Text).Bind(vm => vm.Company)
            .Control(txtBx_saAddress1).Property(txtbx => txtbx.Text).Bind(vm => vm.Address1)
            .Control(txtBx_saAddress2).Property(txtbx => txtbx.Text).Bind(vm => vm.Address2)
            .Control(txtBx_saCity).Property(txtbx => txtbx.Text).Bind(vm => vm.City)
            .Control(txtBx_saPostcode).Property(txtbx => txtbx.Text).Bind(vm => vm.Postcode);
            cmbBx_saCountries.ValueMember   = nameof(Country.ID);
            cmbBx_saCountries.DisplayMember = nameof(Country.Name);
            cmbBx_saZones.ValueMember       = nameof(Zone.ID);
            cmbBx_saZones.DisplayMember     = nameof(Zone.Name);
            // Total Tab
            Create.Binder(presenter.TotalTabVM)
            .Control(cmbBx_orderStatus).Property(cmbbx => cmbbx.DataSource).Get(vm => vm.OrderStatuses)
            .Control(cmbBx_orderStatus).Property(cmbbx => cmbbx.SelectedValue).Bind(vm => vm.Status)
            .Control(lstVw_totalProducts).Property(lst => lst.DataSource).Get(vm => vm.Products)
            .Control(lbl_totals).Property(lbl => lbl.Text).Get(vm => vm.Totals);
            cmbBx_orderStatus.ValueMember   = nameof(OrderStatus.ID);
            cmbBx_orderStatus.DisplayMember = nameof(OrderStatus.Name);
        }