Esempio n. 1
0
        public ActionResult CreateEdit(UWareHouse wareHouse, string Action = "")
        {
            if (ModelState.IsValid)
            {
                if (!wareHouse._wareHouse.Id.Equals(Guid.Empty))
                {
                    wareHouse._wareHouse.CountryProgrammeId = countryProg.Id;
                    if (wareHouseService.EditWareHouse(wareHouse._wareHouse))
                    {
                        ModelState.Clear();
                        wareHouse = new UWareHouse();
                    }
                }
                else
                {
                    wareHouse._wareHouse.CountryProgrammeId = countryProg.Id;
                    if (wareHouseService.AddWareHouse(wareHouse._wareHouse))
                    {
                        ModelState.Clear();
                        wareHouse = new UWareHouse();
                    }
                }
            }


            wareHouse.LocationSelect =
                new SelectList(wareHouseService.LocationObj.GetLocations(), "Id", "Name");

            wareHouse.SubOffSelect = new SelectList(wareHouseService.CtrySubOffObj.GetCountrySubOffices(countryProg.Id),
                                                    "Id", "Address");
            return(ListView());
        }
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (CheckQuality())
     {
         Kho editWareHouse = getWareHouse();
         if (_service.EditWareHouse(editWareHouse))
         {
             MessageBox.Show("Sửa thành công");
             View();
             XoaTrangThongTin();
             grbSua.Visible = false;
         }
         else
         {
             MessageBox.Show("Lỗi hệ thống ", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }