using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BLL { public static class EduTrain_TaskNoticeService { public static Model.EduTrain_TaskNotice GetEduTrain_TaskNoticeById(string TaskNoticeId) { if (string.IsNullOrEmpty(TaskNoticeId)) { return null; } else { return Funs.DB.EduTrain_TaskNotice.FirstOrDefault(e => e.TaskNoticeId == TaskNoticeId); } } public static void AddEduTrain_TaskNotice(Model.EduTrain_TaskNotice newtable) { Model.EduTrain_TaskNotice table = new Model.EduTrain_TaskNotice(); table.TaskNoticeId = newtable.TaskNoticeId; table.CycleStartDate = newtable.CycleStartDate; table.CycleEndDate = newtable.CycleEndDate; table.TrainContent = newtable.TrainContent; table.CreatMan = newtable.CreatMan; table.CreatDate = newtable.CreatDate; table.TrainTitle = newtable.TrainTitle; table.TrainType = newtable.TrainType; table.TeachHour = newtable.TeachHour; table.Units = newtable.Units; table.TeachAddress = newtable.TeachAddress; table.TeachMan = newtable.TeachMan; table.TrainStartDate = newtable.TrainStartDate; table.Cycle = newtable.Cycle; table.ProjectId = newtable.ProjectId; table.AheadOfTime = newtable.AheadOfTime; table.DayOfWeek = newtable.DayOfWeek; table.WeekOfMonth = newtable.WeekOfMonth; table.State = newtable.State; Funs.DB.EduTrain_TaskNotice.InsertOnSubmit(table); Funs.DB.SubmitChanges(); } public static void UpdateEduTrain_TaskNotice(Model.EduTrain_TaskNotice newtable) { Model.EduTrain_TaskNotice table = Funs.DB.EduTrain_TaskNotice.FirstOrDefault(e => e.TaskNoticeId == newtable.TaskNoticeId); if (table != null) { table.TaskNoticeId = newtable.TaskNoticeId; table.CycleStartDate = newtable.CycleStartDate; table.CycleEndDate = newtable.CycleEndDate; table.TrainContent = newtable.TrainContent; table.CreatMan = newtable.CreatMan; table.CreatDate = newtable.CreatDate; table.TrainTitle = newtable.TrainTitle; table.TrainType = newtable.TrainType; table.TeachHour = newtable.TeachHour; table.Units = newtable.Units; table.TeachAddress = newtable.TeachAddress; table.TeachMan = newtable.TeachMan; table.TrainStartDate = newtable.TrainStartDate; table.Cycle = newtable.Cycle; table.ProjectId = newtable.ProjectId; table.AheadOfTime = newtable.AheadOfTime; table.DayOfWeek = newtable.DayOfWeek; table.WeekOfMonth = newtable.WeekOfMonth; table.State = newtable.State; Funs.DB.SubmitChanges(); } } public static void DeleteEduTrain_TaskNoticeById(string TaskNoticeId) { Model.EduTrain_TaskNotice table = Funs.DB.EduTrain_TaskNotice.FirstOrDefault(e => e.TaskNoticeId == TaskNoticeId); if (table != null) { Funs.DB.EduTrain_TaskNotice.DeleteOnSubmit(table); Funs.DB.SubmitChanges(); } } } }