private void EditComputerBrand(int ComputerBrandId)
        {
            this.ComputerBrand = this.srvComputerBrand.GetById(ComputerBrandId);

            this.ClearDetailControls();
            this.LoadFormFromEntity();
            this.frmComputerBrand.HiddenDetail(false);
            this.ShowDetail(true);
        }
 private void DeleteEntity(int ComputerBrandId)
 {
     if (MessageBox.Show("¿Esta seguro de eliminar la Marca de Computadora?", "Advertencia",
                         MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     this.ComputerBrand           = this.srvComputerBrand.GetById(ComputerBrandId);
     this.ComputerBrand.Activated = false;
     this.ComputerBrand.Deleted   = true;
     this.srvComputerBrand.SaveOrUpdate(this.ComputerBrand);
     this.Search();
 }
Ejemplo n.º 3
0
        public override ComputerBrand GetSearchResult()
        {
            ComputerBrand ComputerBrand = null;
            UltraGridRow  activeRow     = this.grdSchSearch.ActiveRow;

            if (activeRow != null)
            {
                int ComputerBrandId = Convert.ToInt32(activeRow.Cells[0].Value);
                ComputerBrand = this.srvComputerBrand.GetById(ComputerBrandId);
            }

            return(ComputerBrand);
        }
Ejemplo n.º 4
0
        public ComputerBrand AddUpdateComputerBrands([FromUri] bool addUpdateBrand, [FromUri] ComputerBrand computerBrand)
        {
            ComputerBrand brand = _db.ComputerBrands.FirstOrDefault(i => i.Id == computerBrand.Id || i.Name == computerBrand.Name.Trim());

            if (brand == null)
            {
                brand = new ComputerBrand
                {
                    Id = 0
                };
            }

            brand.Name     = computerBrand.Name.Trim();
            brand.IsActive = computerBrand.IsActive;

            if (brand.Id == 0)
            {
                _db.ComputerBrands.Add(brand);
            }
            _db.SaveChanges();
            return(brand);
        }
 private void btnSchCreate_Click(object sender, EventArgs e)
 {
     this.ComputerBrand = new ComputerBrand();
     this.ClearDetailControls();
     this.ShowDetail(true);
 }