void GEtSubjectDescription(string SubCode) { txtSubjectDesc.Text = ""; using (Maintenance maintain = new Maintenance()) { txtSubjectDesc.Text = maintain.GetSubject().Where(x => x.Active == true && x.Code == SubCode).FirstOrDefault().Description; } }
void LoadSubjectCode() { cmbSubCode.Items.Clear(); using (Maintenance maintain = new Maintenance()) { maintain.GetSubject().OrderBy(o => o.Code).ToList().ForEach(f => { cmbSubCode.Items.Add(f.Code); }); } }
void LoadSubCode() { cmbSubCode.Items.Clear(); using (Maintenance maintain = new Maintenance()) { maintain.GetSubject().ForEach(x => { cmbSubCode.Items.Add(x.Code); }); } }
void LoadSubject() { int i = 1; dgSubject.Rows.Clear(); using (Maintenance maintain = new Maintenance()) { var value = maintain.GetSubject().Where(x => x.Active == true).OrderBy(o => o.Code).ToList(); value.ForEach(x => { dgSubject.Rows.Add(x.ID, i, x.Code, x.Description, x.Unit, false); i++; }); } txtDescription.ReadOnly = true; }
void LoadSubject() { dgSubject.Rows.Clear(); int i = 1; using (Maintenance _maintain = new Maintenance()) { _maintain.GetSubject().ForEach(x => { dgSubject.Rows.Add(x.ID, i, x.Code, x.Description, x.Active); i++; }); } ObjEnable(false); }
void dgSubject_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgSubject.Rows.Count > 0) { using (Maintenance _maintain = new Maintenance()) { var value = _maintain.GetSubject().Where(x => x.ID == Convert.ToInt64(dgSubject.SelectedRows[0].Cells[0].Value)).FirstOrDefault(); if (value != null) { txtCode.Text = value.Code; txtDescription.Text = value.Description; txtUnit.Value = Convert.ToDecimal(value.Unit.ToString()); cbActive.Checked = value.Active.Value; btnDelete = SystemProperties.BtnProperties(btnDelete, true, Imagename.Delete.ToString(), Imagename._delete.ToString()); btnEdit = SystemProperties.BtnProperties(btnEdit, true, Imagename.Edit.ToString(), Imagename._edit.ToString()); } } } }
void GetRoomSubjectMessage() { cmbMessage.Items.Clear(); cmbRoomCode.Items.Clear(); cmbSubjectCode.Items.Clear(); using (Maintenance maintain = new Maintenance()) { maintain.GetRoom().Where(x => x.Active == true).OrderBy(o => o.RoomCode).ToList().ForEach(y => { cmbRoomCode.Items.Add(y.RoomCode); }); maintain.GetSubject().Where(x => x.Active == true).OrderBy(o => o.Code).ToList().ForEach(y => { cmbSubjectCode.Items.Add(y.Code); }); } using (SMSNotification smsNotify = new SMSNotification()) { smsNotify.GetSMS().Where(x => x.Active == true).ToList().ForEach(s => { cmbMessage.Items.Add(s.Code); }); } }