private void butOK_Click(object sender, EventArgs e)
 {
     if (textFieldCurrency.errorProvider1.GetError(textFieldCurrency) != "")
     {
         MsgBox.Show(this, "Invalid currency");
         return;
     }
     if (_fieldCur.FieldValue == "")          //if blank, then delete
     {
         if (IsNew)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         PatFields.Delete(_fieldCur);
         if (_fieldOld.FieldValue != "")               //We don't need to make a log for field values that were blank because the user simply clicked cancel.
         {
             PatFields.MakeDeleteLogEntry(_fieldOld);
         }
         DialogResult = DialogResult.OK;
         return;
     }
     _fieldCur.FieldValue = textFieldCurrency.Text;
     if (IsNew)
     {
         PatFields.Insert(_fieldCur);
     }
     else
     {
         PatFields.Update(_fieldCur);
         PatFields.MakeEditLogEntry(_fieldOld, _fieldCur);
     }
     DialogResult = DialogResult.OK;
 }
Пример #2
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (!checkFieldValue.Checked)            //if blank, then delete
     {
         if (IsNew)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         PatFields.Delete(_fieldCur);
         if (_fieldOld.FieldValue != "")               //We don't need to make a log for field values that were blank because the user simply clicked cancel.
         {
             PatFields.MakeDeleteLogEntry(_fieldOld);
         }
         DialogResult = DialogResult.OK;
         return;
     }
     _fieldCur.FieldValue = "1";
     if (IsNew)
     {
         PatFields.Insert(_fieldCur);
     }
     else
     {
         //this should never happen
         PatFields.Update(_fieldCur);
         PatFields.MakeEditLogEntry(_fieldOld, _fieldCur);
     }
     DialogResult = DialogResult.OK;
 }
Пример #3
0
 private void butOK_Click(object sender, EventArgs e)
 {
     _fieldCur.FieldValue = textName.Text + "\r\n" + textPhone.Text + "\r\n" + textNote.Text;
     if (string.IsNullOrWhiteSpace(_fieldCur.FieldValue))             //if blank, then delete
     {
         if (IsNew)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         PatFields.Delete(_fieldCur);
         if (!string.IsNullOrWhiteSpace(_fieldOld.FieldValue))
         {
             PatFields.MakeDeleteLogEntry(_fieldOld);
         }
         DialogResult = DialogResult.OK;
         return;
     }
     if (IsNew)
     {
         PatFields.Insert(_fieldCur);
     }
     else
     {
         PatFields.Update(_fieldCur);
         PatFields.MakeEditLogEntry(_fieldOld, _fieldCur);
     }
     DialogResult = DialogResult.OK;
 }
Пример #4
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (listBoxPick.SelectedItems.Count == 0)
     {
         MsgBox.Show(this, "Please select an item in the list first.");
         return;
     }
     _fieldCur.FieldValue = listBoxPick.SelectedItem.ToString();
     if (_fieldCur.FieldValue == "")          //if blank, then delete
     {
         if (IsNew)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         PatFields.Delete(_fieldCur);
         if (_fieldOld.FieldValue != "")               //We don't need to make a log for field values that were blank because the user simply clicked cancel.
         {
             PatFields.MakeDeleteLogEntry(_fieldOld);
         }
         DialogResult = DialogResult.OK;
         return;
     }
     if (IsNew)
     {
         PatFields.Insert(_fieldCur);
     }
     else
     {
         PatFields.Update(_fieldCur);
         PatFields.MakeEditLogEntry(_fieldOld, _fieldCur);
     }
     DialogResult = DialogResult.OK;
 }
Пример #5
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (listBoxPick.SelectedItems.Count == 0)
     {
         MsgBox.Show(this, "Please select an item in the list first.");
         return;
     }
     Field.FieldValue = listBoxPick.SelectedItem.ToString();
     if (Field.FieldValue == "")          //if blank, then delete
     {
         if (IsNew)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         PatFields.Delete(Field);
         DialogResult = DialogResult.OK;
         return;
     }
     if (IsNew)
     {
         PatFields.Insert(Field);
     }
     else
     {
         PatFields.Update(Field);
     }
     DialogResult = DialogResult.OK;
 }
Пример #6
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (!checkFieldValue.Checked)            //if blank, then delete
     {
         if (IsNew)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         PatFields.Delete(Field);
         DialogResult = DialogResult.OK;
         return;
     }
     Field.FieldValue = "1";
     if (IsNew)
     {
         PatFields.Insert(Field);
     }
     else
     {
         //this should never happen
         PatFields.Update(Field);
     }
     DialogResult = DialogResult.OK;
 }
Пример #7
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textFieldDate.errorProvider1.GetError(textFieldDate) != "")
     {
         MsgBox.Show(this, "Invalid date");
         return;
     }
     if (Field.FieldValue == "")          //if blank, then delete
     {
         if (IsNew)
         {
             DialogResult = DialogResult.Cancel;
             return;
         }
         PatFields.Delete(Field);
         DialogResult = DialogResult.OK;
         return;
     }
     Field.FieldValue = textFieldDate.Text;
     if (IsNew)
     {
         PatFields.Insert(Field);
     }
     else
     {
         PatFields.Update(Field);
     }
     DialogResult = DialogResult.OK;
 }
Пример #8
0
        private void gridPat_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            PatField field = PatFields.GetByName(PatFieldDefs.List[e.Row].FieldName, listPatientFields);

            if (field == null)
            {
                field           = new PatField();
                field.PatNum    = PatCur.PatNum;
                field.FieldName = PatFieldDefs.List[e.Row].FieldName;
                if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Text)
                {
                    FormPatFieldEdit FormPF = new FormPatFieldEdit(field);
                    FormPF.IsNew = true;
                    FormPF.ShowDialog();
                }
                if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.PickList)
                {
                    FormPatFieldPickEdit FormPF = new FormPatFieldPickEdit(field);
                    FormPF.IsNew = true;
                    FormPF.ShowDialog();
                }
                if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Date)
                {
                    FormPatFieldDateEdit FormPF = new FormPatFieldDateEdit(field);
                    FormPF.IsNew = true;
                    FormPF.ShowDialog();
                }
                if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Checkbox)
                {
                    FormPatFieldCheckEdit FormPF = new FormPatFieldCheckEdit(field);
                    FormPF.IsNew = true;
                    FormPF.ShowDialog();
                }
            }
            else
            {
                if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Text)
                {
                    FormPatFieldEdit FormPF = new FormPatFieldEdit(field);
                    FormPF.ShowDialog();
                }
                if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.PickList)
                {
                    FormPatFieldPickEdit FormPF = new FormPatFieldPickEdit(field);
                    FormPF.ShowDialog();
                }
                if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Date)
                {
                    FormPatFieldDateEdit FormPF = new FormPatFieldDateEdit(field);
                    FormPF.ShowDialog();
                }
                if (PatFieldDefs.List[e.Row].FieldType == PatFieldType.Checkbox)
                {
                    FormPatFieldCheckEdit FormPF = new FormPatFieldCheckEdit(field);
                    FormPF.ShowDialog();
                }
            }
            FillGridPat();
        }
Пример #9
0
 private void FormPatFieldDefEdit_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (DialogResult == DialogResult.OK)
     {
         return;
     }
     if (IsNew)
     {
         PatFields.Delete(Field);
     }
 }
Пример #10
0
        private void FillGridPat()
        {
            gridPat.BeginUpdate();
            gridPat.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn("Field", 150);
            gridPat.Columns.Add(col);
            col = new ODGridColumn("Value", 200);
            gridPat.Columns.Add(col);
            gridPat.Rows.Clear();
            _arrayPatientFields = PatFields.Refresh(_patCur.PatNum);
            PatFieldDefs.RefreshCache();
            PatFieldL.AddPatFieldsToGrid(gridPat, _arrayPatientFields.ToList(), FieldLocations.OrthoChart);
            gridPat.EndUpdate();
        }
Пример #11
0
 private void gridPat_CellDoubleClick(object sender, ODGridClickEventArgs e)
 {
     if (gridPat.Rows[e.Row].Tag is PatFieldDef)             //patfield for an existing PatFieldDef
     {
         PatFieldDef patFieldDef = (PatFieldDef)gridPat.Rows[e.Row].Tag;
         PatField    field       = PatFields.GetByName(patFieldDef.FieldName, _arrayPatientFields);
         PatFieldL.OpenPatField(field, patFieldDef, _patCur.PatNum, true);
     }
     else if (gridPat.Rows[e.Row].Tag is PatField)             //PatField for a PatFieldDef that no longer exists
     {
         PatField         field  = (PatField)gridPat.Rows[e.Row].Tag;
         FormPatFieldEdit FormPF = new FormPatFieldEdit(field);
         FormPF.IsLaunchedFromOrtho = true;
         FormPF.ShowDialog();
     }
     FillGridPat();
 }
Пример #12
0
        private void FillGridPat()
        {
            gridPat.BeginUpdate();
            gridPat.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn("Field", 150);
            gridPat.Columns.Add(col);
            col = new ODGridColumn("Value", 200);
            gridPat.Columns.Add(col);
            gridPat.Rows.Clear();
            listPatientFields = PatFields.Refresh(PatCur.PatNum);
            PatFieldDefs.RefreshCache();
            ODGridRow row;

            //define and fill rows in grid at the same time.
            for (int i = 0; i < PatFieldDefs.List.Length; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(PatFieldDefs.List[i].FieldName);
                for (int j = 0; j <= listPatientFields.Length; j++)
                {
                    if (j == listPatientFields.Length)                   //no matches in the list
                    {
                        row.Cells.Add("");
                        break;
                    }
                    if (listPatientFields[j].FieldName == PatFieldDefs.List[i].FieldName)
                    {
                        if (PatFieldDefs.List[i].FieldType == PatFieldType.Checkbox)
                        {
                            row.Cells.Add("X");
                        }
                        else
                        {
                            row.Cells.Add(listPatientFields[j].FieldValue);
                        }
                        break;
                    }
                }
                gridPat.Rows.Add(row);
            }
            gridPat.EndUpdate();
        }
Пример #13
0
        /*private void buttonDelete_Click(object sender,EventArgs e) {
         *
         * }*/

        private void butOK_Click(object sender, System.EventArgs e)
        {
            Field.FieldValue = textValue.Text;
            if (Field.FieldValue == "")          //if blank, then delete
            {
                if (IsNew)
                {
                    DialogResult = DialogResult.Cancel;
                    return;
                }
                PatFields.Delete(Field);
                DialogResult = DialogResult.OK;
                return;
            }
            if (IsNew)
            {
                PatFields.Insert(Field);
            }
            else
            {
                PatFields.Update(Field);
            }
            DialogResult = DialogResult.OK;
        }