public ActionResult CalcTrainingInfo(string training_id, bool need_timelen) { var res = new TRes { bok = false, msg = string.Empty }; if (string.IsNullOrEmpty(training_id)) { res.msg = "培训ID必须提供"; return(Json(res)); } Guid gTrainingID = Guid.Empty; if (!Guid.TryParse(training_id, out gTrainingID)) { res.msg = "培训ID有问题"; return(Json(res)); } var nTrainee = TraineeInfo.GetCountByTrainingID(gTrainingID); TCourseEntry courInfo = null; if (need_timelen) { courInfo = TrainingInfo.GetRefCourse(gTrainingID); } res.bok = true; res.data = new { nTrainee = nTrainee, courTimeLen = (null == courInfo) ? 0.0 : courInfo.timeLen }; return(Json(res)); }
public SpecialtyPropertyForm(string division, bool isCheck) : this() { this.division = division; this.isCheck = isCheck; traineeList = TraineeInfo.GetAll().FindAll(a => a.届别 == division); }
public ActionResult AddTrainee(string snr, string trainingid) { var res = new TRes { data = 0, msg = string.Empty }; Guid gTrainingID = Guid.Empty; if (!Guid.TryParse(trainingid, out gTrainingID)) { res.msg = "培训id无效"; return(Json(res)); } var serr = string.Empty; TPersonInfo personInfo = null; res.data = TraineeInfo.Add(snr, gTrainingID, out personInfo, out serr); res.msg = serr; //var cnt = TraineeInfo.GetCountByTrainingID(gTrainingID); res.extra = new { //cnt = cnt, personInfo = personInfo }; return(Json(res)); }
public ActionResult GetTrainees(string training_id) { var res = new TRes { bok = false, msg = string.Empty }; if (string.IsNullOrEmpty(training_id)) { res.msg = "培训ID必须提供"; return(Json(res)); } Guid gTrainingID = Guid.Empty; if (!Guid.TryParse(training_id, out gTrainingID)) { res.msg = "培训ID有问题"; return(Json(res)); } var trainees = TraineeInfo.LoadByTrainingID(gTrainingID, CommonInfo.PAGE_SIZE, -1); if (trainees != null) { //var cnt = TraineeInfo.GetCountByTrainingID(gTrainingID); res.data = trainees.Count; res.extra = trainees; } res.bok = true; return(Json(res)); }
public ActionResult Edit(TraineeInfo traineeInfo) { if (!ModelState.IsValid) { return(View("~/Views/ErrorValidations/Null.cshtml")); } var traineeInfoInDb = _context.TraineeInfos.SingleOrDefault(c => c.TraineeInfoId == traineeInfo.TraineeInfoId); if (traineeInfoInDb == null) { return(HttpNotFound()); } traineeInfoInDb.TraineeId = traineeInfo.TraineeId; traineeInfoInDb.Full_Name = traineeInfo.Full_Name; traineeInfoInDb.Education = traineeInfo.Education; traineeInfoInDb.Programming_Language = traineeInfo.Programming_Language; traineeInfoInDb.Age = traineeInfo.Age; traineeInfoInDb.Experience_Details = traineeInfo.Experience_Details; traineeInfoInDb.Location = traineeInfo.Location; traineeInfoInDb.Toeic_Score = traineeInfo.Toeic_Score; traineeInfoInDb.Department = traineeInfo.Department; _context.SaveChanges(); if (User.IsInRole("Training Staff")) { return(RedirectToAction("Index")); } if (User.IsInRole("Trainee")) { return(RedirectToAction("Mine")); } return(RedirectToAction("Index")); }
public GeneralAndExportBussiness(TraineeInfo traineeDal, GeneralInfo generalDal, BlockClassManagement blocks, RegularClassManagement regulars, TraineeManagementBussiness trainees) { _traineeDal = traineeDal; _generalDal = generalDal; _billExporter = new PDFExporterBill(blocks, regulars, trainees); _dbRelated = new DBExporterGeneral(); }
public ActionResult DeleteConfirmed(int id) { TraineeInfo traineeInfo = _context.TraineeInfos.Find(id); _context.TraineeInfos.Remove(traineeInfo); _context.SaveChanges(); return(RedirectToAction("Index")); }
public StatisticManagementBussiness(PaymentInfo paymentDal, TraineeManagementBussiness trainees, BlockClassManagement blocks, RegularClassManagement regulars, NameCallingBussiness calling, TraineeInfo trainee, OverdueManagementBussiness overdue) { GeneralDal = new GeneralInfo(); Finance = new FinanceStatisticBussiness(paymentDal, trainees, blocks, regulars, GeneralDal); Teacher = new TeachingStatisticBussiness(calling, regulars, blocks); Trainee = new TraineeStatisticBussiness(trainees, regulars, new RegularTraineeBussiness(trainee), overdue, calling); General = new GeneralAndExportBussiness(trainees.Dal, GeneralDal, blocks, regulars, trainees); }
public TraineeManagementBussiness() { Dal = new TraineeInfo(); _trinees = Dal.GetList(); if (_trinees == null) { _trinees = new List <TraineeModel>(); } _blockTrainnesCannotBeChosen = new List <string>(); }
public PDFExporterCallingList(TraineeInfo traineeDAL) : base() { TotalCols = 13; if (!Directory.Exists(GlobalVariables.CallingListPDFExportPath)) { Directory.CreateDirectory(GlobalVariables.CallingListPDFExportPath); } regular = new RegularClassManagement(); block = new BlockClassManagement(); regularTrainee = new RegularTraineeBussiness(traineeDAL); blockTrainee = new BlockTraineeBussiness(traineeDAL); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TraineeInfo traineeInfo = _context.TraineeInfos.Find(id); if (traineeInfo == null) { return(HttpNotFound()); } return(View(traineeInfo)); }
public ActionResult DelTrainee(string sid) { var res = new TRes { bok = false, msg = string.Empty }; var serr = string.Empty; res.bok = TraineeInfo.DeleteByID(sid, out serr); res.msg = serr; return(Json(res)); }
public ActionResult Create() { //Get Trainee var role = (from r in _context.Roles where r.Name.Contains("Trainee") select r) .FirstOrDefault(); var users = _context.Users.Where(x => x.Roles.Select(y => y.RoleId) .Contains(role.Id)) .ToList(); //Get Course var courses = _context.Courses.ToList(); var newTrainee = new TraineeInfo { Trainees = users, }; return(View(newTrainee)); }
List <ManagementTraineeInfoInput> CreateEditingRows() { List <ManagementTraineeInfoInput> list = new List <ManagementTraineeInfoInput>(); //清除历史记录 ManagementTraineeInfoInput.ClearTraineeInfo(division, grade); //通过薪等编号获取员工名单 List <EmployeeInfo> emp_list = GetEmployeeList(); //排序 emp_list = emp_list.OrderBy(a => a.部门序号).ThenBy(a => a.机构序号).ThenBy(a => a.机构名称).ThenBy(a => a.员工序号).ToList(); int order = 1; foreach (EmployeeInfo emp in emp_list) { TraineeInfo ti = TraineeInfo.Get(emp.员工编号); if (ti != null && ti.届别 == division && ti.岗位级别 == grade) { ManagementSpecialtyProperty sp = ManagementSpecialtyProperty.GetManagementSpecialtyProperty(division, grade, ti.学历, ti.学习专业); //创建员工月薪记录 ManagementTraineeInfoInput ms = ManagementTraineeInfoInput.AddManagementTraineeInfoInput(emp.员工编号, isCheck); ms.序号 = order; ms.届别 = division; ms.岗位级别 = grade; ms.学历 = ti.学历; ms.专业名称 = ti.学习专业; ms.入职时间 = ti.入职时间; ms.专业属性 = sp == null ? "" : sp.属性; ms.Save(); list.Add(ms); order++; } } return(list); }
public ActionResult Create(TraineeInfo traineeInfo) { if (!ModelState.IsValid) { return(View("~/Views/ErrorValidations/Null.cshtml")); } var newTraineeInfo = new TraineeInfo { TraineeId = traineeInfo.TraineeId, Full_Name = traineeInfo.Full_Name, Education = traineeInfo.Education, Programming_Language = traineeInfo.Programming_Language, Age = traineeInfo.Age, Experience_Details = traineeInfo.Experience_Details, Location = traineeInfo.Location, Toeic_Score = traineeInfo.Toeic_Score, Department = traineeInfo.Department, }; _context.TraineeInfos.Add(newTraineeInfo); _context.SaveChanges(); return(RedirectToAction("Index")); }
public PaymentManagementBussiness(BlockClassManagement block, RegularClassManagement regular, TraineeInfo trainee, NameCallingBussiness nameCalling) { PaymentDAL = new PaymentInfo(); ClassPayment = new ClassPaymentBussiness(block, regular, trainee, PaymentDAL, nameCalling); NormalPayment = new NormalPaymentBussiness(PaymentDAL); }
public ClassPaymentBussiness(BlockClassManagement block, RegularClassManagement regular, TraineeInfo trainee, PaymentInfo dal, NameCallingBussiness nameCalling) { ClassFee = new ClassFeeBussiness(block, regular, trainee, dal); TeacherFee = new TeacherFeeBussiness(nameCalling); ClassFee.GeneralCapitalChanged += (sender, args) => CapitalChanged?.Invoke(sender, args); TeacherFee.GeneralCapitalChanged += (sender, args) => CapitalChanged?.Invoke(sender, args); }
public BlockTraineeBussiness(TraineeInfo traineeDAL) { _dal = traineeDAL; TraineeOperation = new TraineeOperationBussiness(); TraineeOperation.TraineeChangedEvent += OnTraineeChanged; }
public NameCallingMangementBussiness(BlockClassManagement block, RegularClassManagement regular, TraineeInfo trainee, TraineeManagementBussiness trainees) { RegularTrainee = new RegularTraineeBussiness(trainee); BlockTrainee = new BlockTraineeBussiness(trainee); NameCalling = new NameCallingBussiness(); ClassSelecter = new ClassSelecterBussiness(regular, block, RegularTrainee, BlockTrainee); EditCalling = new EditNameCallingBussiness(NameCalling, block, regular, new ClassSelecterBussiness(regular, block, new RegularTraineeBussiness(trainee), new BlockTraineeBussiness(trainee)), trainees); }
private bool CheckSpecialtyValid(ManagementSpecialtyPropertyInput row) { TraineeInfo item = traineeList.Find(a => a.岗位级别 == row.岗位级别 && a.学历 == row.学历 && a.学习专业 == row.专业名称); return(item != null); }
public ClassFeeBussiness(BlockClassManagement block, RegularClassManagement regular, TraineeInfo trainee, PaymentInfo dal) { ClassSelecter = new ClassSelecterBussiness(regular, block, new RegularTraineeBussiness(trainee), new BlockTraineeBussiness(trainee), true); CountPayment = new PaymentInCountBussiness(); _dal = dal; ClassSelecter.ClassTypeChangedEvent += CountPayment.OnClassTypeChanged; ClassSelecter.SelectedClassChangedEvent += CountPayment.OnClassModelChanged; }
public OthersBussiness(TraineeInfo traineeDAL) { _exportCallingList = new PDFExporterCallingList(traineeDAL); }