public bool HealthDetailUpdate(HealthExaminationDetail entity) { try { HealthExaminationDetailTable = db.GetTable <HealthExaminationDetail>(); HealthExaminationDetail model = HealthExaminationDetailTable.SingleOrDefault(x => x.HealthExaminationDetailID.Equals(entity.HealthExaminationDetailID)); model.HealthExaminationID = entity.HealthExaminationID; model.StudentID = entity.StudentID; model.HealthInsurance = entity.HealthInsurance; model.Height = entity.Height; model.Weight = entity.Weight; model.Eyes = entity.Eyes; model.ENT = entity.ENT; model.Oral = entity.Oral; model.InternalMedicine = entity.InternalMedicine; model.Surgery = entity.Surgery; model.Dermatology = entity.Dermatology; model.BoneMuscle = entity.BoneMuscle; model.Nerve = entity.Nerve; model.Endocrine = entity.Endocrine; model.Other = entity.Other; model.Note = entity.Note; model.Rating = entity.Rating; model.Status = entity.Status; db.SubmitChanges(); return(true); } catch { return(false); } }
private void InsertStudent() { HealthExaminationDetail entity = new HealthExaminationDetail(); HealthExaminationDetailDAO m_HealthExamDAO = new HealthExaminationDetailDAO(); if (iFunction == 1) { int a1 = gridView1.SelectedRowsCount; int[] a = gridView1.GetSelectedRows(); for (int i = 0; i < a1; i++) { entity.StudentID = (int)gridView1.GetRowCellValue(a[i], gridView1.Columns["StudentID"]); entity.HealthExaminationID = healthExamination.HealthExaminationID; entity.HealthInsurance = "-- Chọn loại bảo hiểm --"; entity.Height = 1; entity.Weight = 1; entity.Rating = "Chưa đánh giá"; entity.Status = false; if (m_HealthExamDAO.HealthDetailInsert(entity) == true) { } else { XtraMessageBox.Show("Bản ghi " + i + "bị lỗi"); } } XtraMessageBox.Show("Thêm kết quả khám sức khỏe thành công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; this.Close(); } }
public bool HealthDetailInsert(HealthExaminationDetail entity) { try { HealthExaminationDetailTable = db.GetTable <HealthExaminationDetail>(); HealthExaminationDetailTable.InsertOnSubmit(entity); db.SubmitChanges(); return(true); } catch { return(false); } }
public bool HealthDetailDelete(int HealthExaminationDetailID) { try { HealthExaminationDetailTable = db.GetTable <HealthExaminationDetail>(); HealthExaminationDetail model = HealthExaminationDetailTable.SingleOrDefault(x => x.HealthExaminationDetailID.Equals(HealthExaminationDetailID)); db.HealthExaminationDetails.DeleteOnSubmit(model); db.SubmitChanges(); return(true); } catch { return(false); } }
public bool HealthDetailInsert(HealthExaminationDetail entity) { HealthExaminationDetail a = new HealthExaminationDetail(); a.HealthExaminationID = entity.HealthExaminationID; a.StudentID = entity.StudentID; a.HealthInsurance = entity.HealthInsurance; a.Status = false; a.Height = entity.Height; a.Weight = entity.Weight; a.Rating = entity.Rating; db.HealthExaminationDetails.InsertOnSubmit(a); db.SubmitChanges(); return(true); }