public ActionResult AddSchool() { List<MODEL.SCHOOL> list = sbll.GetListBy(s => s.SCHOOL_ID != "0").OrderByDescending(s => int.Parse(s.SCHOOL_ID)).Select(s => s.TOPOCO()).ToList(); string maxSchoolID = ""; if (list.Count > 0) { maxSchoolID = (int.Parse(list[0].SCHOOL_ID) + 1).ToString(); } else { maxSchoolID = "1"; } MODEL.SCHOOL school = new MODEL.SCHOOL() { SCHOOL_NAME = Request["schoolname"], SCHOOL_N = Request["schooln"], SCHOOL_AREA = Request["schoolarea"], SCHOOL_TYPE = Request["schooltype"], SCHOOL_ID = maxSchoolID }; if (sbll.Add(school) > 0) { return Content("Y"); } else { return Content("N"); } }
public ActionResult editSchool() { MODEL.SCHOOL school = new MODEL.SCHOOL() { SCHOOL_ID = Request["schoolId"], SCHOOL_NAME = Request["schoolname_edit"], SCHOOL_N = Request["schooln_edit"], SCHOOL_AREA = Request["schoolarea_edit"], SCHOOL_TYPE = Request["schooltype_edit"] }; if (sbll.Modify(school, "SCHOOL_NAME", "SCHOOL_N", "SCHOOL_TYPE", "SCHOOL_AREA") > 0) { return Content("Y"); } else { return Content("N"); } }