private void SubscribeToEvents() { productsDetailUC.SaveProductsDetailEventRaised += (sender, modelDictionary) => { ProductsDtoModel productDto = new ProductsDtoModel { Id = modelDictionary.ModelDictionary["Id"] == "" ? 0 : int.Parse(modelDictionary.ModelDictionary["Id"]), SupplierId = Convert.ToInt32(modelDictionary.ModelDictionary["SupplierId"]), CategoryId = Convert.ToInt32(modelDictionary.ModelDictionary["CategoryId"]), GroupId = modelDictionary.ModelDictionary["GroupId"] == "" ? 0 : Convert.ToInt32(modelDictionary.ModelDictionary["GroupId"]), NameWebStore = modelDictionary.ModelDictionary["NameWebStore"], NameSupplier = modelDictionary.ModelDictionary["NameSupplier"], CodeWebStore = modelDictionary.ModelDictionary["CodeWebStore"], CodeSupplier = modelDictionary.ModelDictionary["CodeSupplier"], UnitId = Convert.ToInt32(modelDictionary.ModelDictionary["UnitId"]), PriceWebStore = Convert.ToDecimal(modelDictionary.ModelDictionary["PriceWebStore"]), PriceSupplier = Convert.ToDecimal(modelDictionary.ModelDictionary["PriceSupplier"]), Available = modelDictionary.ModelDictionary["Available"], LinkWebStore = modelDictionary.ModelDictionary["LinkWebStore"], LinkSupplier = modelDictionary.ModelDictionary["LinkSupplier"], Notes = modelDictionary.ModelDictionary["Notes"] }; if (productDto.Id > 0) { facade.UpdateProduct(productDto); } else { facade.AddProduct(productDto); } EventHelper.RaiseEvent(this, SaveProductClickEventRaised, new EventArgs()); }; productsDetailUC.CancelProductsDetailEventRaised += (sender, e) => EventHelper.RaiseEvent(this, CancelClickEventRaised, new EventArgs()); }