Пример #1
0
 public IPDTreatmentForm(IPDTreatment treatment)
     : base(treatment)
 {
     this.mEntry = treatment;
     this.InitializeComponent();
     this.UserInitialize();
 }
        private void OnAddClick(object sender, EventArgs e)
        {
            IPDTreatment obj = new IPDTreatment();

            if (IPDTreatmentForm.ShowForm(obj))
            {
                this.LoadListData(obj);
            }
        }
Пример #3
0
        public static bool ShowForm(IPDTreatment obj)
        {
            bool r = false;

            if (!Objectbase.IsNullOrEmpty(obj))
            {
                using (IPDTreatmentForm frm = new IPDTreatmentForm(obj))
                {
                    r = frm.ShowDialog() == DialogResult.OK;
                }
            }
            return(r);
        }
        private void OnOpenClick(object sender, EventArgs e)
        {
            IPDTreatment obj = this.GetSelected();

            if (obj != null)
            {
                obj.RefershData();
            }

            if (IPDTreatmentForm.ShowForm(obj))
            {
                this.LoadListData(obj);
            }
        }
        private void LoadListData(IPDTreatment selected)
        {
            int count = 0;

            this.LoadEntityList <IPDTreatment>(this.dgvData, this.clmName.Index, new Treatments(tstSearch.Text), selected,
                                               delegate(DataGridViewRow row, IPDTreatment obj)
            {
                count++;
                row.Cells[this.clmName.Index].Value        = obj.Name;
                row.Cells[this.clmDescription.Index].Value = obj.Description;
            }
                                               );
            bool hasRows = count > 0;

            this.tsbOpen.Enabled = hasRows;
        }