Пример #1
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            Def DefCur = new Def();

            DefCur.ItemOrder = DefsList.Length;
            DefCur.Category  = (DefCat)SelectedCat;
            DefCur.ItemName  = "";
            DefCur.ItemValue = "";          //necessary
            if (lookupCat[listCategory.SelectedIndex] == DefCat.ImageCats)
            {
                FormDefEditImages FormDEI = new FormDefEditImages(DefCur);
                FormDEI.IsNew = true;
                FormDEI.ShowDialog();
                if (FormDEI.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            else
            {
                FormDefEdit FormDE = new FormDefEdit(DefCur);
                FormDE.IsNew = true;
                FormDE.ShowDialog();
                if (FormDE.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            DefsSelected   = DefsList.Length;        //this is one more than allowed, but it's ok
            DefsIsSelected = true;
            changed        = true;
            FillDefs();
        }
Пример #2
0
        private void gridConfStatuses_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Def         defConfirmation = (Def)gridConfStatuses.ListGridRows[e.Row].Tag;
            FormDefEdit FormDE          = new FormDefEdit(defConfirmation, _listDefsApptStatus, new DefCatOptions(DefCat.ApptConfirmed, enableColor: true, enableValue: true));

            FormDE.ShowDialog();
            if (FormDE.DialogResult == DialogResult.OK)
            {
                Defs.RefreshCache();
                _listDefsApptStatus = Defs.GetDefsForCategory(DefCat.ApptConfirmed, true);
                FillConfStatusesGrid();
            }
        }
Пример #3
0
        public static bool GridDefsDoubleClick(Def selectedDef, ODGrid gridDefs, DefCatOptions selectedDefCatOpt, List <Def> listDefsCur, List <Def> listDefsAll, bool isDefChanged)
        {
            switch (selectedDefCatOpt.DefCat)
            {
            case DefCat.BlockoutTypes:
                FormDefEditBlockout FormDEB = new FormDefEditBlockout(selectedDef);
                FormDEB.ShowDialog();
                if (FormDEB.DialogResult == DialogResult.OK)
                {
                    isDefChanged = true;
                }
                break;

            case DefCat.ImageCats:
                FormDefEditImages FormDEI = new FormDefEditImages(selectedDef);
                FormDEI.IsNew = false;
                FormDEI.ShowDialog();
                if (FormDEI.DialogResult == DialogResult.OK)
                {
                    isDefChanged = true;
                }
                break;

            case DefCat.WebSchedNewPatApptTypes:
                FormDefEditWSNPApptTypes FormDEWSNPAT = new FormDefEditWSNPApptTypes(selectedDef);
                if (FormDEWSNPAT.ShowDialog() == DialogResult.OK)
                {
                    if (FormDEWSNPAT.IsDeleted)
                    {
                        listDefsAll.Remove(selectedDef);
                    }
                    isDefChanged = true;
                }
                break;

            default:                    //Show the normal FormDefEdit window.
                FormDefEdit FormDefEdit2 = new FormDefEdit(selectedDef, listDefsCur, selectedDefCatOpt);
                FormDefEdit2.IsNew = false;
                FormDefEdit2.ShowDialog();
                if (FormDefEdit2.DialogResult == DialogResult.OK)
                {
                    if (FormDefEdit2.IsDeleted)
                    {
                        listDefsAll.Remove(selectedDef);
                    }
                    isDefChanged = true;
                }
                break;
            }
            return(isDefChanged);
        }
Пример #4
0
        private void tbDefs_CellDoubleClicked(object sender, CellEventArgs e)
        {
            tbDefs.BackGColor[0, e.Row] = SystemColors.Highlight;
            tbDefs.BackGColor[1, e.Row] = SystemColors.Highlight;
            tbDefs.Refresh();
            DefsIsSelected = true;
            DefsSelected   = e.Row;
            FormDefEdit FormDefEdit2 = new FormDefEdit(DefsList[e.Row]);

            //Defs.Cur = Defs.List[e.Row];
            FormDefEdit2.IsNew = false;
            FormDefEdit2.ShowDialog();
            //Preferences2.GetCatList(listCategory.SelectedIndex);
            changed = true;
            FillDefs();
        }
Пример #5
0
 private void tbDefs_CellDoubleClicked(object sender, CellEventArgs e)
 {
     tbDefs.BackGColor[0, e.Row] = SystemColors.Highlight;
     tbDefs.BackGColor[1, e.Row] = SystemColors.Highlight;
     tbDefs.Refresh();
     DefsIsSelected = true;
     DefsSelected   = e.Row;
     if (lookupCat[listCategory.SelectedIndex] == DefCat.ImageCats)
     {
         FormDefEditImages FormDEI = new FormDefEditImages(DefsList[e.Row]);
         FormDEI.IsNew = false;
         FormDEI.ShowDialog();
     }
     else
     {
         FormDefEdit FormDefEdit2 = new FormDefEdit(DefsList[e.Row]);
         FormDefEdit2.IsNew = false;
         FormDefEdit2.ShowDialog();
         //Preferences2.GetCatList(listCategory.SelectedIndex);
     }
     changed = true;
     FillDefs();
 }
Пример #6
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            //if(SelectedCat==-1){//never -1.
            //	MessageBox.Show(Lan.g(this,"Please select item first."));
            //	return;
            //}
            Def DefCur = new Def();

            DefCur.ItemOrder = DefsList.Length;
            DefCur.Category  = (DefCat)SelectedCat;
            FormDefEdit FormDE = new FormDefEdit(DefCur);

            FormDE.IsNew = true;
            FormDE.ShowDialog();
            if (FormDE.DialogResult != DialogResult.OK)
            {
                return;
            }
            DefsSelected   = DefsList.Length;        //this is one more than allowed, but it's ok
            DefsIsSelected = true;
            changed        = true;
            FillDefs();
        }
Пример #7
0
 private void butAdd_Click(object sender, System.EventArgs e)
 {
     Def DefCur=new Def();
     DefCur.ItemOrder=DefsList.Length;
     DefCur.Category=(DefCat)SelectedCat;
     DefCur.ItemName="";
     DefCur.ItemValue="";//necessary
     if(lookupCat[listCategory.SelectedIndex]==DefCat.ImageCats) {
         FormDefEditImages FormDEI=new FormDefEditImages(DefCur);
         FormDEI.IsNew=true;
         FormDEI.ShowDialog();
         if(FormDEI.DialogResult!=DialogResult.OK) {
             return;
         }
     }
     else {
         FormDefEdit FormDE=new FormDefEdit(DefCur);
         FormDE.IsNew=true;
         FormDE.ShowDialog();
         if(FormDE.DialogResult!=DialogResult.OK) {
             return;
         }
     }
     DefsSelected=DefsList.Length;//this is one more than allowed, but it's ok
     DefsIsSelected=true;
     changed=true;
     FillDefs();
 }
Пример #8
0
 private void tbDefs_CellDoubleClicked(object sender, CellEventArgs e)
 {
     tbDefs.BackGColor[0,e.Row]=SystemColors.Highlight;
     tbDefs.BackGColor[1,e.Row]=SystemColors.Highlight;
     tbDefs.Refresh();
     DefsIsSelected=true;
     DefsSelected=e.Row;
     if(lookupCat[listCategory.SelectedIndex]==DefCat.ImageCats) {
         FormDefEditImages FormDEI=new FormDefEditImages(DefsList[e.Row]);
         FormDEI.IsNew=false;
         FormDEI.ShowDialog();
     }
     else {
         FormDefEdit FormDefEdit2 = new FormDefEdit(DefsList[e.Row]);
         FormDefEdit2.IsNew=false;
         FormDefEdit2.ShowDialog();
         //Preferences2.GetCatList(listCategory.SelectedIndex);
     }
     changed=true;
     FillDefs();
 }
Пример #9
0
        public static bool AddDef(ODGrid gridDefs, DefCatOptions selectedDefCatOpt)
        {
            Def defCur = new Def();

            defCur.IsNew = true;
            int itemOrder = 0;

            if (Defs.GetDefsForCategory(selectedDefCatOpt.DefCat).Count > 0)
            {
                itemOrder = Defs.GetDefsForCategory(selectedDefCatOpt.DefCat).Max(x => x.ItemOrder) + 1;
            }
            defCur.ItemOrder = itemOrder;
            defCur.Category  = selectedDefCatOpt.DefCat;
            defCur.ItemName  = "";
            defCur.ItemValue = "";          //necessary
            if (selectedDefCatOpt.DefCat == DefCat.InsurancePaymentType)
            {
                defCur.ItemValue = "N";
            }
            switch (selectedDefCatOpt.DefCat)
            {
            case DefCat.BlockoutTypes:
                FormDefEditBlockout FormDEB = new FormDefEditBlockout(defCur);
                FormDEB.IsNew = true;
                if (FormDEB.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }
                break;

            case DefCat.ImageCats:
                FormDefEditImages FormDEI = new FormDefEditImages(defCur);
                FormDEI.IsNew = true;
                FormDEI.ShowDialog();
                if (FormDEI.DialogResult != DialogResult.OK)
                {
                    return(false);
                }
                break;

            case DefCat.WebSchedNewPatApptTypes:
                FormDefEditWSNPApptTypes FormDEWSNPAT = new FormDefEditWSNPApptTypes(defCur);
                if (FormDEWSNPAT.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }
                break;

            default:
                List <Def> listCurrentDefs = new List <Def>();
                foreach (ODGridRow rowCur in gridDefs.Rows)
                {
                    listCurrentDefs.Add((Def)rowCur.Tag);
                }
                FormDefEdit FormDE = new FormDefEdit(defCur, listCurrentDefs, selectedDefCatOpt);
                FormDE.IsNew = true;
                FormDE.ShowDialog();
                if (FormDE.DialogResult != DialogResult.OK)
                {
                    return(false);
                }
                break;
            }
            return(true);
        }