Esempio n. 1
0
        private bool SaveSchoolClass(Yw_SchoolClass schoolClass)
        {
            bool result = false;

            if (schoolClass.Ycc_Id > 0)
            {
                //var old = SchoolClassRepository.Get(schoolClass.Ycc_Id);
                //if (old != null)
                //{
                //    schoolClass.Ycc_CreateTime = old.Ycc_CreateTime;
                //    schoolClass.Ycc_Creator = old.Ycc_Creator;
                //    result = SchoolClassRepository.Update(schoolClass);
                //}
                result = SchoolClassRepository.Update(schoolClass);
            }
            else
            {
                var id = SchoolClassRepository.Insert(schoolClass);
                schoolClass.Ycc_Id = id;
                result             = id > 0;
            }
            return(result);
        }