private void LoaiMonAn(object sender, RoutedEventArgs e) { DataContext = new LoaiMonAnViewModel(); TaiKhoan.Background = Brushes.ForestGreen; donhang.Background = Brushes.ForestGreen; MonAn.Background = Brushes.ForestGreen; loaimonan.Background = Brushes.LightGreen; DoanhThu.Background = Brushes.ForestGreen; nhanvien.Background = Brushes.ForestGreen; }
public HttpResponseMessage Create(HttpRequestMessage request, LoaiMonAnViewModel productCategoryVm) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { response = request.CreateResponse(HttpStatusCode.BadRequest, ModelState); } else { var newProductCategory = new LoaiMonAn(); newProductCategory.UpdateLoaiMonAn(productCategoryVm); //newProductCategory.CreatedDate = DateTime.Now; _productCategoryService.Add(newProductCategory); _productCategoryService.Save(); var responseData = Mapper.Map <LoaiMonAn, LoaiMonAnViewModel>(newProductCategory); response = request.CreateResponse(HttpStatusCode.Created, responseData); } return response; })); }
public static void UpdateLoaiMonAn(this LoaiMonAn loaiMonAn, LoaiMonAnViewModel loaiMonAnVm) { loaiMonAn.MALOAI = loaiMonAnVm.MALOAI; loaiMonAn.TENLOAI = loaiMonAn.TENLOAI; }
public LoaiMonAn() { InitializeComponent(); home = new LoaiMonAnViewModel(); this.DataContext = home; }