コード例 #1
0
        public ActionResult ManageSchoolForm(School school)
        {
            School _school = new School();
            _school.Name = school.Name;
            _school.Country = string.IsNullOrEmpty(school.Country) ? string.Empty : school.Country;
            _school.City = string.IsNullOrEmpty(school.City) ? string.Empty : school.City;
            _school.LogoPath = string.IsNullOrEmpty(school.LogoPath) ? string.Empty : school.LogoPath;

            if (school.ID == Guid.Empty)
            {
                school.ID = Guid.NewGuid();
                int isAdded = _BSchool.Add(school);
                if (isAdded != 0)
                {
                    return Json(new { success = true, message = "School added successfully", status = true });
                }
                return Json(new { success = true, message = "School Name already exist", status = false });
            }
            else
            {
                school.ID = school.ID;
                _BSchool.Update(school);
                return Json(new { success = true, message = "School edit successfully", status = true });
            }
        }
コード例 #2
0
ファイル: BSchool.cs プロジェクト: wajih775/BookSystemRepo
 public void Remove(School obj)
 {
     SchoolRepository.Remove(obj);
 }
コード例 #3
0
ファイル: BSchool.cs プロジェクト: wajih775/BookSystemRepo
 public void Update(School obj)
 {
     SchoolRepository.Update(obj);
 }
コード例 #4
0
ファイル: BSchool.cs プロジェクト: wajih775/BookSystemRepo
 public int Add(School obj)
 {
     return SchoolRepository.Add(obj);
 }