///<summary>Opens a SheetDefEdit window and returns the SheetDef.SheetDefNum.  Returns -1 if user cancels or deletes the Dashboard.</summary>
        private long EditWidget(SheetDef sheetDefWidget = null)
        {
            if (sheetDefWidget == null)
            {
                sheetDefWidget = new SheetDef()
                {
                    SheetType = SheetTypeEnum.PatientDashboardWidget,
                    FontName  = "Microsoft Sans Serif",
                    FontSize  = 9,
                    Height    = 800,
                    Width     = 400,
                };
                FormSheetDef FormSD = new FormSheetDef();
                FormSD.SheetDefCur = sheetDefWidget;
                FormSD.ShowDialog();
                if (FormSD.DialogResult != DialogResult.OK)
                {
                    return(-1);
                }
                sheetDefWidget.SheetFieldDefs = new List <SheetFieldDef>();
                sheetDefWidget.IsNew          = true;
            }
            SheetDefs.GetFieldsAndParameters(sheetDefWidget);
            FormSheetDefEdit FormS = new FormSheetDefEdit(sheetDefWidget);

            if (FormS.ShowDialog() == DialogResult.OK)
            {
                DataValid.SetInvalid(InvalidType.Sheets);
                return(sheetDefWidget.SheetDefNum);
            }
            return(-1);
        }
示例#2
0
        private void butNew_Click(object sender, System.EventArgs e)
        {
            //This button is not enabled unless user has appropriate permission for setup.
            //Not allowed to change sheettype once a sheet is created, so we need to let user pick.
            FormSheetDef FormS = new FormSheetDef();

            FormS.IsInitial  = true;
            FormS.IsReadOnly = false;
            SheetDef sheetdef = new SheetDef();

            sheetdef.FontName = "Microsoft Sans Serif";
            sheetdef.FontSize = 9;
            sheetdef.Height   = 1100;
            sheetdef.Width    = 850;
            FormS.SheetDefCur = sheetdef;
            FormS.ShowDialog();
            if (FormS.DialogResult != DialogResult.OK)
            {
                return;
            }
            //what about parameters?
            sheetdef.SheetFieldDefs = new List <SheetFieldDef>();
            sheetdef.IsNew          = true;
            FormSheetDefEdit FormSD = new FormSheetDefEdit(sheetdef);

            FormSD.ShowDialog();            //It will be saved to db inside this form.
            FillGrid2(sheetdef.SheetDefNum);
            changed = true;
        }
示例#3
0
        private void butNew_Click(object sender, EventArgs e)
        {
            //This button is not enabled unless user has appropriate permission for setup.
            SheetDef sheetDefNew = _listOtherSheetDefs[0].Copy();          //First item is always internal.  Only 1 interal sheet def per instance of this window.

            sheetDefNew.Description = "Custom Layout " + (_listCustomSheetDefs.Count + 1).ToString();
            sheetDefNew.IsNew       = true;
            //sheetDefNew.UserNum=Security.CurUser.UserNum;
            FormSheetDef formSheetDef = new FormSheetDef();

            formSheetDef.IsInitial   = false;        //User can not change SheetType.
            formSheetDef.IsReadOnly  = false;
            formSheetDef.SheetDefCur = sheetDefNew;
            if (formSheetDef.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            FormSheetDefEdit formSheetDefEdit = new FormSheetDefEdit(sheetDefNew);

            formSheetDefEdit.ShowDialog();            //It will be saved to db inside this form.
            _isSignalNeeded = true;
            RefreshAndFillGrids(sheetDefNew.SheetDefNum);
        }
示例#4
0
 private void butNew_Click(object sender, System.EventArgs e)
 {
     //This button is not enabled unless user has appropriate permission for setup.
     //Not allowed to change sheettype once a sheet is created, so we need to let user pick.
     FormSheetDef FormS=new FormSheetDef();
     FormS.IsInitial=true;
     FormS.IsReadOnly=false;
     SheetDef sheetdef=new SheetDef();
     sheetdef.FontName="Microsoft Sans Serif";
     sheetdef.FontSize=9;
     sheetdef.Height=1100;
     sheetdef.Width=850;
     FormS.SheetDefCur=sheetdef;
     FormS.ShowDialog();
     if(FormS.DialogResult!=DialogResult.OK){
         return;
     }
     //what about parameters?
     sheetdef.SheetFieldDefs=new List<SheetFieldDef>();
     sheetdef.IsNew=true;
     FormSheetDefEdit FormSD=new FormSheetDefEdit(sheetdef);
     FormSD.ShowDialog();//It will be saved to db inside this form.
     FillGrid2();
     for(int i=0;i<SheetDefC.Listt.Count;i++){
         if(SheetDefC.Listt[i].SheetDefNum==sheetdef.SheetDefNum){
             grid2.SetSelected(i,true);
         }
     }
     changed=true;
 }
示例#5
0
		private void butEdit_Click(object sender,EventArgs e) {
			FormSheetDef FormS=new FormSheetDef();
			FormS.SheetDefCur=SheetDefCur;
			if(this.IsInternal){
				FormS.IsReadOnly=true;
			}
			FormS.ShowDialog();
			if(FormS.DialogResult!=DialogResult.OK){
				return;
			}
			textDescription.Text=SheetDefCur.Description;
			//resize
			if(SheetDefCur.IsLandscape){
				panelMain.Width=SheetDefCur.Height;
				panelMain.Height=SheetDefCur.Width;
			}
			else{
				panelMain.Width=SheetDefCur.Width;
				panelMain.Height=SheetDefCur.Height;
			}
			panelMain.Height=SheetDefCur.HeightTotal-(SheetDefCur.PageCount==1?0:SheetDefCur.PageCount*100-40);
			FillFieldList();
			RefreshDoubleBuffer();
			panelMain.Refresh();
		}