Beispiel #1
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormSheetPicker FormS = new FormSheetPicker();

            FormS.SheetType       = SheetTypeEnum.PatientForm;
            FormS.HideKioskButton = true;
            FormS.ShowDialog();
            if (FormS.DialogResult != DialogResult.OK)
            {
                return;
            }
            //Make sure each selected sheet contains FName, LName, and Birthdate.
            for (int i = 0; i < FormS.SelectedSheetDefs.Count; i++)       //There will always only be one
            {
                if (!WebFormL.VerifyRequiredFieldsPresent(FormS.SelectedSheetDefs[i]))
                {
                    return;
                }
            }
            Cursor = Cursors.WaitCursor;
            if (!TestWebServiceExists())
            {
                Cursor = Cursors.Default;
                MsgBox.Show(this, "Either the web service is not available or the WebHostSynch URL is incorrect");
                return;
            }
            for (int i = 0; i < FormS.SelectedSheetDefs.Count; i++)       //There will always only be one
            {
                WebFormL.LoadImagesToSheetDef(FormS.SelectedSheetDefs[i]);
                wh.Timeout = 300000;               //for slow connections more timeout is provided. The  default is 100 seconds i.e 100000
                wh.UpLoadSheetDef(RegistrationKey, FormS.SelectedSheetDefs[i]);
            }
            FillGrid();
            Cursor = Cursors.Default;
        }
Beispiel #2
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            FormSheetPicker FormS = new FormSheetPicker();

            FormS.SheetType       = SheetTypeEnum.PatientForm;
            FormS.HideKioskButton = true;
            FormS.ShowDialog();
            if (FormS.DialogResult != DialogResult.OK)
            {
                return;
            }
            //Make sure each selected sheet contains FName, LName, and Birthdate.
            foreach (SheetDef selectedSheetDef in FormS.SelectedSheetDefs)             //There will always only be one
            {
                if (!WebFormL.VerifyRequiredFieldsPresent(selectedSheetDef))
                {
                    return;
                }
            }
            Cursor = Cursors.WaitCursor;
            foreach (SheetDef selectedSheetDef in FormS.SelectedSheetDefs)
            {
                WebFormL.LoadImagesToSheetDef(selectedSheetDef);
                WebFormL.TryAddOrUpdateSheetDef(this, selectedSheetDef, true);
            }
            FillGrid();
            Cursor = Cursors.Default;
        }
Beispiel #3
0
        private void butUpdate_Click(object sender, EventArgs e)
        {
            if (gridMain.SelectedIndices.Length < 1)
            {
                MsgBox.Show(this, "Please select an item from the grid first.");
                return;
            }
            if (gridMain.SelectedIndices.Length > 1)
            {
                MsgBox.Show(this, "Please select one web form at a time.");
                return;
            }
            webforms_sheetdef wf_sheetDef = (webforms_sheetdef)gridMain.Rows[gridMain.SelectedIndices[0]].Tag;
            SheetDef          sheetDef    = SheetDefs.GetFirstOrDefault(x => x.SheetDefNum == wf_sheetDef.SheetDefNum);

            if (sheetDef == null)           //This web form has never had a SheetDefNum assigned or the sheet has been deleted.
            {
                MsgBox.Show(this, "This Web Form is not linked to a valid Sheet.  Please select the correct Sheet that this Web Form should be linked to.");
                FormSheetPicker FormS = new FormSheetPicker();
                FormS.SheetType       = SheetTypeEnum.PatientForm;
                FormS.HideKioskButton = true;
                FormS.ShowDialog();
                if (FormS.DialogResult != DialogResult.OK || FormS.SelectedSheetDefs.Count == 0)
                {
                    return;
                }
                sheetDef = FormS.SelectedSheetDefs.FirstOrDefault();
            }
            else              //sheetDef not null
            {
                SheetDefs.GetFieldsAndParameters(sheetDef);
            }
            if (!WebFormL.VerifyRequiredFieldsPresent(sheetDef))
            {
                return;
            }
            Cursor = Cursors.WaitCursor;
            if (!TestWebServiceExists())
            {
                Cursor = Cursors.Default;
                MsgBox.Show(this, "Either the web service is not available or the WebHostSynch URL is incorrect");
                return;
            }
            WebFormL.LoadImagesToSheetDef(sheetDef);
            wh.UpdateSheetDef(RegistrationKey, wf_sheetDef.WebSheetDefID, sheetDef);
            FillGrid();
            Cursor = Cursors.Default;
        }
Beispiel #4
0
        private void butUpdate_Click(object sender, EventArgs e)
        {
            if (gridMain.SelectedIndices.Length < 1)
            {
                MsgBox.Show(this, "Please select an item from the grid first.");
                return;
            }
            if (gridMain.SelectedIndices.Length > 1)
            {
                MsgBox.Show(this, "Please select one web form at a time.");
                return;
            }
            WebForms_SheetDef wf_sheetDef = gridMain.SelectedTag <WebForms_SheetDef>();
            SheetDef          sheetDef    = SheetDefs.GetFirstOrDefault(x => x.SheetDefNum == wf_sheetDef.SheetDefNum);

            if (sheetDef == null)           //This web form has never had a SheetDefNum assigned or the sheet has been deleted.
            {
                MsgBox.Show(this, "This Web Form is not linked to a valid Sheet.  Please select the correct Sheet that this Web Form should be linked to.");
                FormSheetPicker FormS = new FormSheetPicker();
                FormS.SheetType       = SheetTypeEnum.PatientForm;
                FormS.HideKioskButton = true;
                FormS.ShowDialog();
                if (FormS.DialogResult != DialogResult.OK || FormS.SelectedSheetDefs.Count == 0)
                {
                    return;
                }
                sheetDef = FormS.SelectedSheetDefs.FirstOrDefault();
            }
            else              //sheetDef not null
            {
                SheetDefs.GetFieldsAndParameters(sheetDef);
            }
            if (!WebFormL.VerifyRequiredFieldsPresent(sheetDef))
            {
                return;
            }
            Cursor = Cursors.WaitCursor;
            WebFormL.LoadImagesToSheetDef(sheetDef);
            WebFormL.TryAddOrUpdateSheetDef(this, sheetDef, false, new List <WebForms_SheetDef> {
                wf_sheetDef
            });
            FillGrid();
            Cursor = Cursors.Default;
        }