コード例 #1
0
 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;
     }
 }
コード例 #2
0
 void LoadSubjectCode()
 {
     cmbSubCode.Items.Clear();
     using (Maintenance maintain = new Maintenance())
     {
         maintain.GetSubject().OrderBy(o => o.Code).ToList().ForEach(f =>
         {
             cmbSubCode.Items.Add(f.Code);
         });
     }
 }
コード例 #3
0
 void LoadSubCode()
 {
     cmbSubCode.Items.Clear();
     using (Maintenance maintain = new Maintenance())
     {
         maintain.GetSubject().ForEach(x =>
         {
             cmbSubCode.Items.Add(x.Code);
         });
     }
 }
コード例 #4
0
        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;
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 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());
             }
         }
     }
 }
コード例 #7
0
 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);
         });
     }
 }