예제 #1
0
 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;
 }
예제 #2
0
        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;
            }));
        }
예제 #3
0
 public static void UpdateLoaiMonAn(this LoaiMonAn loaiMonAn, LoaiMonAnViewModel loaiMonAnVm)
 {
     loaiMonAn.MALOAI  = loaiMonAnVm.MALOAI;
     loaiMonAn.TENLOAI = loaiMonAn.TENLOAI;
 }
예제 #4
0
 public LoaiMonAn()
 {
     InitializeComponent();
     home             = new LoaiMonAnViewModel();
     this.DataContext = home;
 }