示例#1
0
        public Manufacturer SaveInfo()
        {
            var manufacturer = ManufacturerManager.GetManufacturerById(this.ManufacturerId);

            if (manufacturer != null)
            {
                Picture        manufacturerPicture     = manufacturer.Picture;
                HttpPostedFile manufacturerPictureFile = fuManufacturerPicture.PostedFile;
                if ((manufacturerPictureFile != null) && (!String.IsNullOrEmpty(manufacturerPictureFile.FileName)))
                {
                    byte[] manufacturerPictureBinary = PictureManager.GetPictureBits(manufacturerPictureFile.InputStream, manufacturerPictureFile.ContentLength);
                    if (manufacturerPicture != null)
                    {
                        manufacturerPicture = PictureManager.UpdatePicture(manufacturerPicture.PictureId, manufacturerPictureBinary, manufacturerPictureFile.ContentType, true);
                    }
                    else
                    {
                        manufacturerPicture = PictureManager.InsertPicture(manufacturerPictureBinary, manufacturerPictureFile.ContentType, true);
                    }
                }
                int manufacturerPictureId = 0;
                if (manufacturerPicture != null)
                {
                    manufacturerPictureId = manufacturerPicture.PictureId;
                }

                manufacturer = ManufacturerManager.UpdateManufacturer(manufacturer.ManufacturerId, txtName.Text,
                                                                      txtDescription.Content, int.Parse(this.ddlTemplate.SelectedItem.Value),
                                                                      manufacturer.MetaKeywords, manufacturer.MetaDescription,
                                                                      manufacturer.MetaTitle, manufacturer.SEName,
                                                                      manufacturerPictureId, manufacturer.PageSize, txtPriceRanges.Text,
                                                                      cbPublished.Checked, manufacturer.Deleted, txtDisplayOrder.Value,
                                                                      manufacturer.CreatedOn, DateTime.UtcNow);
            }
            else
            {
                Picture        manufacturerPicture     = null;
                HttpPostedFile manufacturerPictureFile = fuManufacturerPicture.PostedFile;
                if ((manufacturerPictureFile != null) && (!String.IsNullOrEmpty(manufacturerPictureFile.FileName)))
                {
                    byte[] manufacturerPictureBinary = PictureManager.GetPictureBits(manufacturerPictureFile.InputStream, manufacturerPictureFile.ContentLength);
                    manufacturerPicture = PictureManager.InsertPicture(manufacturerPictureBinary, manufacturerPictureFile.ContentType, true);
                }
                int manufacturerPictureId = 0;
                if (manufacturerPicture != null)
                {
                    manufacturerPictureId = manufacturerPicture.PictureId;
                }

                DateTime nowDt = DateTime.UtcNow;
                manufacturer = ManufacturerManager.InsertManufacturer(txtName.Text, txtDescription.Content,
                                                                      int.Parse(this.ddlTemplate.SelectedItem.Value),
                                                                      string.Empty, string.Empty, string.Empty, string.Empty,
                                                                      manufacturerPictureId, 10, txtPriceRanges.Text, cbPublished.Checked, false, txtDisplayOrder.Value, nowDt, nowDt);
            }

            SaveLocalizableContent(manufacturer);

            return(manufacturer);
        }
示例#2
0
        public async Task <ActionResult> Get()
        {
            var viewModels = (await ManufacturerManager.GetAllAsync <Manufacturer>()).Select(
                Mapper.Map <Manufacturer, ManufacturerViewModel>).ToArray();

            return(Json(viewModels, AllowGet));
        }
示例#3
0
        private List <ProductManufacturerMappingHelperClass> GetProductManufacturerMappings(List <ProductManufacturer> ExistingProductManufacturerCollection)
        {
            var manufacturerCollection = ManufacturerManager.GetAllManufacturers();
            List <ProductManufacturerMappingHelperClass> result = new List <ProductManufacturerMappingHelperClass>();

            for (int i = 0; i < manufacturerCollection.Count; i++)
            {
                Manufacturer        manufacturer = manufacturerCollection[i];
                ProductManufacturer existingProductManufacturer = null;
                if (ExistingProductManufacturerCollection != null)
                {
                    existingProductManufacturer = ExistingProductManufacturerCollection.FindProductManufacturer(this.ProductId, manufacturer.ManufacturerId);
                }
                ProductManufacturerMappingHelperClass pmm = new ProductManufacturerMappingHelperClass();
                if (existingProductManufacturer != null)
                {
                    pmm.ProductManufacturerId = existingProductManufacturer.ProductManufacturerId;
                    pmm.IsMapped     = true;
                    pmm.IsFeatured   = existingProductManufacturer.IsFeaturedProduct;
                    pmm.DisplayOrder = existingProductManufacturer.DisplayOrder;
                }
                else
                {
                    pmm.DisplayOrder = 1;
                }
                pmm.ManufacturerId   = manufacturer.ManufacturerId;
                pmm.ManufacturerInfo = manufacturer.Name;

                MapState(manufacturer.ManufacturerId, pmm);

                result.Add(pmm);
            }

            return(result);
        }
示例#4
0
        private void BindData()
        {
            var manufacturer = ManufacturerManager.GetManufacturerById(this.ManufacturerId);

            if (this.HasLocalizableContent)
            {
                var languages = this.GetLocalizableLanguagesSupported();
                rptrLanguageTabs.DataSource = languages;
                rptrLanguageTabs.DataBind();
                rptrLanguageDivs.DataSource = languages;
                rptrLanguageDivs.DataBind();
            }

            if (manufacturer != null)
            {
                this.txtName.Text           = manufacturer.Name;
                this.txtDescription.Content = manufacturer.Description;
                CommonHelper.SelectListItem(this.ddlTemplate, manufacturer.TemplateId);

                var manufacturerPicture = manufacturer.Picture;
                btnRemoveManufacturerImage.Visible = manufacturerPicture != null;
                string pictureUrl = PictureManager.GetPictureUrl(manufacturerPicture, 100);
                this.iManufacturerPicture.Visible  = true;
                this.iManufacturerPicture.ImageUrl = pictureUrl;

                this.txtPriceRanges.Text   = manufacturer.PriceRanges;
                this.cbPublished.Checked   = manufacturer.Published;
                this.txtDisplayOrder.Value = manufacturer.DisplayOrder;
            }
            else
            {
                this.btnRemoveManufacturerImage.Visible = false;
                this.iManufacturerPicture.Visible       = false;
            }
        }
示例#5
0
        protected void BindGrid()
        {
            var manufacturers = ManufacturerManager.GetAllManufacturers();

            gvManufacturers.DataSource = manufacturers;
            gvManufacturers.DataBind();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(this.ManufacturerID);

            if (manufacturer != null)
            {
                ProductManufacturerCollection existingProductManufacturers = manufacturer.ProductManufacturers;

                foreach (GridViewRow row in gvProducts.Rows)
                {
                    try
                    {
                        CheckBox       cbProductInfo      = row.FindControl("cbProductInfo") as CheckBox;
                        HiddenField    hfProductID        = row.FindControl("hfProductID") as HiddenField;
                        NumericTextBox txtRowDisplayOrder = row.FindControl("txtDisplayOrder") as NumericTextBox;
                        int            productID          = int.Parse(hfProductID.Value);
                        int            displayOrder       = txtRowDisplayOrder.Value;
                        if (cbProductInfo.Checked)
                        {
                            if (existingProductManufacturers.FindProductManufacturer(productID, this.ManufacturerID) == null)
                            {
                                ManufacturerManager.InsertProductManufacturer(productID, this.ManufacturerID, false, displayOrder);
                            }
                        }
                    }
                    catch (Exception exc)
                    {
                        ProcessException(exc);
                    }
                }
            }

            this.Page.ClientScript.RegisterStartupScript(typeof(ManufacturerProductAddControl), "closerefresh", "<script language=javascript>try {window.opener.document.forms[0]." + this.BtnID + ".click();}catch (e){} window.close();</script>");
        }
 public ManufacturersController(
     ManufacturerManager manufacturerManager,
     ILogger <ManufacturersController> logger)
 {
     _manufacturerManager = manufacturerManager;
     _logger = logger;
 }
示例#8
0
 public WorkController()
 {
     carsmanager            = new CarsManager();
     ordermanager           = new OrderManager();
     manufacturrerViewModel = new manufacturrerViewModel();
     ManufacturerManager    = new ManufacturerManager();
 }
示例#9
0
        public void SaveInfo()
        {
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(this.ManufacturerID);

            if (manufacturer != null)
            {
                foreach (GridViewRow row in gvProductManufacturerMappings.Rows)
                {
                    CheckBox       cbProductInfo           = row.FindControl("cbProductInfo") as CheckBox;
                    HiddenField    hfProductID             = row.FindControl("hfProductID") as HiddenField;
                    HiddenField    hfProductManufacturerID = row.FindControl("hfProductManufacturerID") as HiddenField;
                    CheckBox       cbFeatured         = row.FindControl("cbFeatured") as CheckBox;
                    NumericTextBox txtRowDisplayOrder = row.FindControl("txtDisplayOrder") as NumericTextBox;

                    int  productID             = int.Parse(hfProductID.Value);
                    int  productManufacturerID = int.Parse(hfProductManufacturerID.Value);
                    bool featured     = cbFeatured.Checked;
                    int  displayOrder = txtRowDisplayOrder.Value;

                    if (productManufacturerID > 0 && !cbProductInfo.Checked)
                    {
                        ManufacturerManager.DeleteProductManufacturer(productManufacturerID);
                    }
                    if (productManufacturerID > 0 && cbProductInfo.Checked)
                    {
                        ManufacturerManager.UpdateProductManufacturer(productManufacturerID, productID, manufacturer.ManufacturerID, featured, displayOrder);
                    }
                }
            }
        }
        private void BindData()
        {
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(this.ManufacturerID);

            if (manufacturer != null)
            {
                this.txtName.Text         = manufacturer.Name;
                this.txtDescription.Value = manufacturer.Description;
                CommonHelper.SelectListItem(this.ddlTemplate, manufacturer.TemplateID);

                Picture manufacturerPicture = manufacturer.Picture;
                btnRemoveManufacturerImage.Visible = manufacturerPicture != null;
                string pictureUrl = PictureManager.GetPictureUrl(manufacturerPicture, 100);
                this.iManufacturerPicture.Visible  = true;
                this.iManufacturerPicture.ImageUrl = pictureUrl;

                this.txtPriceRanges.Text   = manufacturer.PriceRanges;
                this.cbPublished.Checked   = manufacturer.Published;
                this.txtDisplayOrder.Value = manufacturer.DisplayOrder;
            }
            else
            {
                this.btnRemoveManufacturerImage.Visible = false;
                this.iManufacturerPicture.Visible       = false;
            }
        }
示例#11
0
        protected void BindData()
        {
            try
            {
                StringBuilder sb = new StringBuilder();
                if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeCategories", true))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.Categories"));
                    sb.Append("<ul>");
                    WriteCategories(sb, CategoryManager.GetAllCategories(0));
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeManufacturers", true))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.Manufacturers"));
                    sb.Append("<ul>");
                    WriteManufacturers(sb, ManufacturerManager.GetAllManufacturers());
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeProducts", true))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.Products"));
                    sb.Append("<ul>");
                    WriteProducts(sb, ProductManager.GetAllProducts());
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeTopics", true))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.Topics"));
                    sb.Append("<ul>");
                    WriteTopics(sb, TopicManager.GetAllTopics());
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                string otherPages = SettingManager.GetSettingValue("Sitemap.OtherPages");
                if (!String.IsNullOrEmpty(otherPages))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.OtherPages"));
                    sb.Append("<ul>");
                    WriteOtherPages(sb, otherPages.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }

                lSitemapContent.Text = sb.ToString();
            }
            catch (Exception ex)
            {
                lSitemapContent.Text = ex.Message;
                LogManager.InsertLog(LogTypeEnum.CommonError, ex.Message, ex);
            }
        }
示例#12
0
 public ClientResponse FindManufacturer(string q, int limit)
 {
     return(new ClientResponse(() =>
     {
         using (var manager = new ManufacturerManager(null))
             return manager.SearchManufacturer((int)Company.MatrixId, q, limit).ToArray();
     }));
 }
示例#13
0
        public async Task <ActionResult> Index()
        {
            var items = (await ManufacturerManager.GetAllAsync <Manufacturer>())
                        .Select(Mapper.Map <Manufacturer, ManufacturerViewModel>)
                        .OrderBy(x => x.Name).ToArray();

            return(View(items));
        }
        protected void SaveLocalizableContent(Manufacturer manufacturer)
        {
            if (manufacturer == null)
            {
                return;
            }

            if (!this.HasLocalizableContent)
            {
                return;
            }

            foreach (RepeaterItem item in rptrLanguageDivs.Items)
            {
                if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                {
                    var txtLocalizedMetaKeywords    = (TextBox)item.FindControl("txtLocalizedMetaKeywords");
                    var txtLocalizedMetaDescription = (TextBox)item.FindControl("txtLocalizedMetaDescription");
                    var txtLocalizedMetaTitle       = (TextBox)item.FindControl("txtLocalizedMetaTitle");
                    var txtLocalizedSEName          = (TextBox)item.FindControl("txtLocalizedSEName");
                    var lblLanguageId = (Label)item.FindControl("lblLanguageId");

                    int    languageId      = int.Parse(lblLanguageId.Text);
                    string metaKeywords    = txtLocalizedMetaKeywords.Text;
                    string metaDescription = txtLocalizedMetaDescription.Text;
                    string metaTitle       = txtLocalizedMetaTitle.Text;
                    string seName          = txtLocalizedSEName.Text;

                    bool allFieldsAreEmpty = (string.IsNullOrEmpty(metaKeywords) &&
                                              string.IsNullOrEmpty(metaDescription) &&
                                              string.IsNullOrEmpty(metaTitle) &&
                                              string.IsNullOrEmpty(seName));

                    var content = ManufacturerManager.GetManufacturerLocalizedByManufacturerIdAndLanguageId(manufacturer.ManufacturerId, languageId);
                    if (content == null)
                    {
                        if (!allFieldsAreEmpty && languageId > 0)
                        {
                            //only insert if one of the fields are filled out (avoid too many empty records in db...)
                            content = ManufacturerManager.InsertManufacturerLocalized(manufacturer.ManufacturerId,
                                                                                      languageId, string.Empty, string.Empty,
                                                                                      metaKeywords, metaDescription, metaTitle, seName);
                        }
                    }
                    else
                    {
                        if (languageId > 0)
                        {
                            content = ManufacturerManager.UpdateManufacturerLocalized(content.ManufacturerLocalizedId, content.ManufacturerId,
                                                                                      languageId, content.Name, content.Description,
                                                                                      metaKeywords, metaDescription,
                                                                                      metaTitle, seName);
                        }
                    }
                }
            }
        }
示例#15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SEOHelper.RenderTitle(this, GetLocaleResourceString("PageTitle.Manufactures"), true);
     if (!IsPostBack)
     {
         dlManufacturers.DataSource = ManufacturerManager.GetAllManufacturers();
         dlManufacturers.DataBind();
     }
 }
示例#16
0
 public ProductListCrudConsoleService(CategoryManager categoryManager,
                                      CharacteristicManager characteristicManager,
                                      ManufacturerManager manufacturerManager,
                                      ProductManager productManager)
 {
     _categoryManager       = categoryManager;
     _characteristicManager = characteristicManager;
     _manufacturerManager   = manufacturerManager;
     _productManager        = productManager;
 }
示例#17
0
        /// <summary>
        /// Starts the carrying behavior.
        /// </summary>
        public void Carry(Warehouse warehouse, ManufacturerManager manager, int amount)
        {
            m_requestedItems = Mathf.Min(amount, MaxCarriedItems);

            m_manager   = manager;
            m_warehouse = warehouse;

            m_traveling = true;
            StartCoroutine(Move(m_manager.transform.position));
        }
示例#18
0
        private void WriteManufacturers()
        {
            var manufacturers = ManufacturerManager.GetAllManufacturers(false);

            foreach (var manufacturer in manufacturers)
            {
                var url             = SEOHelper.GetManufacturerUrl(manufacturer);
                var updateFrequency = UpdateFrequency.Weekly;
                var updateTime      = manufacturer.UpdatedOn;
                WriteUrlLocation(url, updateFrequency, updateTime);
            }
        }
示例#19
0
 public ProductBaseConsoleService(ProductManager productManager,
                                  OrderManager orderManager,
                                  BuyerManager buyerManager,
                                  ManufacturerManager manufacturerManager,
                                  CharacteristicManager characteristicManager)
 {
     _productManager        = productManager;
     _orderManager          = orderManager;
     _buyerManager          = buyerManager;
     _manufacturerManager   = manufacturerManager;
     _characteristicManager = characteristicManager;
 }
示例#20
0
 protected void DeleteButton_Click(object sender, EventArgs e)
 {
     try
     {
         ManufacturerManager.MarkManufacturerAsDeleted(this.ManufacturerID);
         Response.Redirect("Manufacturers.aspx");
     }
     catch (Exception exc)
     {
         ProcessException(exc);
     }
 }
示例#21
0
        private void BindData()
        {
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(this.ManufacturerID);

            if (manufacturer != null)
            {
                ProductManufacturerCollection existingProductManufacturerCollection      = manufacturer.ProductManufacturers;
                List <ProductManufacturerMappingHelperClass> productManufacturerMappings = GetProductManufacturerMappings(existingProductManufacturerCollection);
                gvProductManufacturerMappings.DataSource = productManufacturerMappings;
                gvProductManufacturerMappings.DataBind();
            }
        }
        private void WriteManufacturers()
        {
            ManufacturerCollection manufacturers = ManufacturerManager.GetAllManufacturers(false);

            foreach (Manufacturer manufacturer in manufacturers)
            {
                string          url             = SEOHelper.GetManufacturerURL(manufacturer);
                UpdateFrequency updateFrequency = UpdateFrequency.weekly;
                DateTime        updateTime      = manufacturer.UpdatedOn;
                WriteUrlLocation(url, updateFrequency, updateTime);
            }
        }
示例#23
0
 public ProductsController(
     ProductManager productManager,
     CategoryManager categoryManager,
     ManufacturerManager manufacturerManager,
     CharacteristicManager characteristicManager,
     ILogger <ProductsController> logger)
 {
     _productManager        = productManager;
     _categoryManager       = categoryManager;
     _manufacturerManager   = manufacturerManager;
     _characteristicManager = characteristicManager;
     _logger = logger;
 }
示例#24
0
        private void BindData()
        {
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(this.ManufacturerID);

            if (manufacturer != null)
            {
                this.txtMetaKeywords.Text    = manufacturer.MetaKeywords;
                this.txtMetaDescription.Text = manufacturer.MetaDescription;
                this.txtMetaTitle.Text       = manufacturer.MetaTitle;
                this.txtSEName.Text          = manufacturer.SEName;
                this.txtPageSize.Value       = manufacturer.PageSize;
            }
        }
示例#25
0
        public void SaveInfo()
        {
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(this.ManufacturerID);

            if (manufacturer != null)
            {
                manufacturer = ManufacturerManager.UpdateManufacturer(manufacturer.ManufacturerID, manufacturer.Name, manufacturer.Description,
                                                                      manufacturer.TemplateID, txtMetaKeywords.Text, txtMetaDescription.Text,
                                                                      txtMetaTitle.Text, txtSEName.Text, manufacturer.PictureID, txtPageSize.Value,
                                                                      manufacturer.PriceRanges, manufacturer.Published,
                                                                      manufacturer.Deleted, manufacturer.DisplayOrder, manufacturer.CreatedOn, manufacturer.UpdatedOn);
            }
        }
示例#26
0
        private void BindData()
        {
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerById(this.ManufacturerId);

            if (manufacturer != null)
            {
                var existingProductManufacturerCollection = manufacturer.ProductManufacturers;
                List <ProductManufacturerMappingHelperClass> productManufacturerMappings = GetProductManufacturerMappings(existingProductManufacturerCollection);
                gvProductManufacturerMappings.Columns[1].Visible = SettingManager.GetSettingValueBoolean("Display.ShowAdminProductImages");
                gvProductManufacturerMappings.DataSource         = productManufacturerMappings;
                gvProductManufacturerMappings.DataBind();
            }
        }
示例#27
0
        private void companySaveButton_Click(object sender, EventArgs e)
        {
            string companyName = companyEntryTextBox.Text;

            Manufacturer aManufacturer = new Manufacturer();

            aManufacturer.Name = companyName;

            ManufacturerManager manufacturerManager = new ManufacturerManager();
            string msg = manufacturerManager.Save(aManufacturer);

            MessageBox.Show(msg);
        }
示例#28
0
        public FrmSearchProduct(FrmDanhMucSanPham frmParent)
        {
            InitializeComponent();

            productManager = new ProductManager();
            productNameManager = new ProductNameManager();
            categoryManager = new CategoryManager();
            unitManager = new UnitManager();
            countryManager = new CountryManager();
            manufacturerManager = new ManufacturerManager();
            productStatusManager = new ProductStatusManager();

            this.frmParent = frmParent;
        }
示例#29
0
        protected void BindData()
        {
            ManufacturerCollection manufacturers = ManufacturerManager.GetAllManufacturers();

            if (manufacturers.Count > 0)
            {
                rptrManufacturers.DataSource = manufacturers;
                rptrManufacturers.DataBind();
            }
            else
            {
                this.Visible = false;
            }
        }
示例#30
0
        private Product InsertManufacturer(Product product)
        {
            //
            //Função que valida o FABRICANTE
            //
            var manufacturerManager = new ManufacturerManager(this);

            if (!String.IsNullOrEmpty(txtManufacturer.Text))
            {
                product.ManufacturerId = manufacturerManager.TryManufacturer(txtManufacturer.Text);
            }

            return(product);
        }
        public void SaveInfo(int manId)
        {
            Manufacturer manufacturer = ManufacturerManager.GetManufacturerById(manId, 0);

            if (manufacturer != null)
            {
                manufacturer = ManufacturerManager.UpdateManufacturer(manufacturer.ManufacturerId, manufacturer.Name, manufacturer.Description,
                                                                      manufacturer.TemplateId, txtMetaKeywords.Text, txtMetaDescription.Text,
                                                                      txtMetaTitle.Text, txtSEName.Text, manufacturer.PictureId, txtPageSize.Value,
                                                                      manufacturer.PriceRanges, manufacturer.Published,
                                                                      manufacturer.Deleted, manufacturer.DisplayOrder, manufacturer.CreatedOn, manufacturer.UpdatedOn);
            }

            SaveLocalizableContent(manufacturer);
        }
示例#32
0
        public FrmDanhMucSanPham()
        {
            InitializeComponent();

            //Create Manager which will use in form
            productManager = new ProductManager();
            productNameManager = new ProductNameManager();
            productStatusManager = new ProductStatusManager();
            unitManager = new UnitManager();

            categoryManager = new CategoryManager();
            manufacturerManager = new ManufacturerManager();
            countryManager = new CountryManager();
            providerManager = new ProviderManager();

            //
            MODE = Constants.MODE.ADD;
        }
 public ClientResponse FindManufacturer(string q, int limit)
 {
     return new ClientResponse(() =>
     {
         using (var manager = new ManufacturerManager(null))
             return manager.SearchManufacturer((int)Company.MatrixId, q, limit).ToArray();
     });
 }
示例#34
0
文件: NhapHang.cs 项目: hamalawy/ssmp
 private void cboTenSanPham_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (cboTenSanPham.SelectedValue.ToString().Length == 0) return;
         int khoa = Int32.Parse(cboTenSanPham.SelectedValue.ToString());
         ProductNameManager productNameManager = new ProductNameManager();
         ProductName productName = productNameManager.GetById(khoa, true);
         cboLoaiSanPham.SelectedValue = productName.CategoryIdLookup.ID;
         cboNhaSanXuat.SelectedValue = productName.ManIdLookup.ID;
         ManufacturerManager manufacturerManager = new ManufacturerManager();
         Manufacturer man = manufacturerManager.GetById(productName.ManIdLookup.ID, true);
         cboNguonGoc.SelectedValue = man.CountryIdLookup.ID;
     }
     catch (Exception ex) {}
 }
        private Product InsertManufacturer(Product product)
        {
            //
            //Função que valida o FABRICANTE
            //
            var manufacturerManager = new ManufacturerManager(this);

            if (!String.IsNullOrEmpty(txtManufacturer.Text))
                product.ManufacturerId = manufacturerManager.TryManufacturer(txtManufacturer.Text);

            return product;
        }