コード例 #1
0
 /// <summary>
 /// makes the creation of the PDF of the user about the medical threats
 /// </summary>
 /// <param name="userDet">user information, stored by the perogram</param>
 /// <param name="userId">DB identifier of the user</param>
 /// <param name="outputPath">the output path, to create the PDF</param>
 public void createHealthCarePDF(SetOfUserDetails userDet)
 {
     try
     {
         modelOwnPersManage = new PersonalProfileModelDB(dbci, parent);
         chems  = modelOwnPersManage.getUserConnectedChemThreats(userDet.userArea);
         accids = modelOwnPersManage.getUserConnectedAccidents(userDet.userId);
     }
     catch (ErrorServiceProfileDetailsManage e)
     {
         throw new ErrorServiceProfileMange(e.Message);
     }
     try
     {
         modelPDFPersonal = new PersonalProfileModelPDFhc(userDet, dbci.output, chems, accids);
     }
     catch (ErrorMigraDocFileCreation e)
     {
         throw new ErrorServiceProfileMange(e.Message);
     }
     catch (Exception e)
     {
         throw new ErrorServiceProfileMange("Ismeretlen eredetű hiba történt (ServProfDet-PDFcreate) "
                                            + e.Message);
     }
 }
コード例 #2
0
        //it works with PDFSharp-MigraDoc-GDI by empria Software BmbH v. 1.32.4334
        public PersonalProfileModelPDFhc(SetOfUserDetails userDet, string pathOfOutput, List <string> chem,
                                         List <string[]> accid)
        {
            string filename = userDet.userLastName + "Adatlapja" + DateTime.Today.Year.ToString() +
                              DateTime.Today.Month.ToString() + DateTime.Today.Day.ToString() + ".pdf";

            try
            {
                if (!Directory.Exists(pathOfOutput))
                {
                    Directory.CreateDirectory(pathOfOutput);
                }
                this.path += pathOfOutput + filename;
            }
            catch (Exception e)
            {
                throw new ErrorMigraDocFileCreation("Probléma van a fájl célmappájával (ModPers-PDFfolder) " + e.Message);
            }
            adjustPageMetaDatas(userDet);
            adjustHeader(userDet);
            addChemicalsToPDF(chem);
            addAccidentsToPDF(accid);
            addFooterToPDF();
            finishPDF(path);
        }
コード例 #3
0
 /// <summary>
 /// adjust the details of the loged-in-user
 /// </summary>
 /// <returns>the set of details in the program</returns>
 public SetOfUserDetails getTheUserDetailsFromDB()
 {
     userDetails = new SetOfUserDetails();
     string[] userDatas = modelLogin.getUserDetails();
     try
     {
         userDetails.userId           = userDatas[0];
         userDetails.userName         = userName;
         userDetails.userLastName     = userDatas[1];
         userDetails.userFirstName    = userDatas[2];
         userDetails.userTaj          = userDatas[3];
         userDetails.userPosition     = userDatas[4];
         userDetails.userArea         = userDatas[5];
         userDetails.userAccountGroup = userDatas[6];
         userDetails.completlynessSeek();
     }
     catch (ErrorUserDetailsCompletlyness)
     {
         throw new ErrorServiceLoginInfoCollect("Felhasználói adatok gyűjtése sikertelen (ServLoginData)");
     }
     catch (Exception e)
     {
         throw new ErrorServiceLoginInfoCollect("Ismeretlen probléma lépett fel (ServLoginData) "
                                                + e.Message);
     }
     return(userDetails);
 }
コード例 #4
0
 public FormServiceProfileWindow(SetOfUserDetails usod, UserConnDetails dbci, Form parentMain)
 {
     InitializeComponent();
     this.parentMainWindow = parentMain;
     this.dbci             = dbci;
     this.usod             = usod;
     personalController    = new ServiceProfileWinController(usod, dbci, this);
 }
コード例 #5
0
 public FormServiceOrderingWindow(SetOfUserDetails soud, OrderingWindowPurpose mode, Form parentMain, ServiceOrdering servOrd)
 {
     InitializeComponent();
     controllerOrd   = new ServiceOrderingWinController(soud, mode, servOrd, this);
     this.parentMain = parentMain;
     this.Show();
     parentMain.Hide();
 }
コード例 #6
0
 public MainController(SetOfUserDetails soud, SetOfUserRights sour, Form parentalMainWindow, UserConnDetails dbci)
 {
     this.mainWindow       = parentalMainWindow;
     this.setOfUserDetails = soud;
     this.dbci             = dbci;
     initializeMainWindowElementsByRightsOfUser(sour);
     catchTheControlsOfServices();
 }
コード例 #7
0
 /// <summary>
 /// constructor of the profile manager wiondow - only, that instatntiate its servise itself!
 /// </summary>
 /// <param name="usod">personal details of the user</param>
 /// <param name="dbci">DB connection informations</param>
 /// <param name="personalWin">the address of the profile manager window</param>
 public ServiceProfileWinController(SetOfUserDetails usod, UserConnDetails dbci, Form personalWin)
 {
     this.personalWin = personalWin;
     this.usod        = usod;
     this.dbci        = dbci;
     catchWindowcontrols();
     setTheNormalViewOfWindow();
 }
コード例 #8
0
 public ServiceOrderingWinController(SetOfUserDetails userDatas, OrderingWindowPurpose windMode, ServiceOrdering serviceOrd, Form parentWinOrd)
 {
     this.parentOrdWin     = parentWinOrd;
     this.servOrdering     = serviceOrd;
     this.windoProcessMode = windMode;
     catchTheControls();
     adjutTheFieldsWithProperDatas(userDatas);
 }
コード例 #9
0
 public FormServiceOrdBookArriveWin(List <OrderingNoted> listNoted, Form parentMain, ServiceOrdering servOrd,
                                    SetOfUserDetails soud)
 {
     InitializeComponent();
     controllOrdBookArrive = new ServiceOrdBookArriveWinController(listNoted, this, servOrd, soud);
     this.Show();
     this.parentMain = parentMain;
     parentMain.Hide();
 }
コード例 #10
0
 /// <summary>
 /// adjust the metadata of the healthcare-form pdf
 /// </summary>
 /// <param name="name">the name of the person</param>
 private void adjustPageMetaDatas(SetOfUserDetails userDet)
 {
     doc              = new Document();
     doc.Info.Author  = userDet.userLastName + " " + userDet.userFirstName;
     doc.Info.Subject = "healt-datasheet with chemicals and accidents";
     doc.Info.Title   = "Healthcare datasheet of " + userDet.userLastName + " " + userDet.userFirstName;
     adjustPageSize();   //passive
     adjustPageSytle();  //passive
 }
コード例 #11
0
 /// <summary>
 /// constructor of MainFormWindow
 /// </summary>
 /// <param name="parentLogin">loginFormWindow itself</param>
 /// <param name="userRights">rights of logged in user</param>
 /// <param name="userDetails">personal details of loggen in user</param>
 /// <param name="dbci">connection informations</param>
 public FormMainWindow(Form parentLogin, SetOfUserRights userRights, SetOfUserDetails userDetails,
                       UserConnDetails dbci)
 {
     InitializeComponent();
     this.parentLogInWindow = parentLogin;
     this.setOfUserDetails  = userDetails;
     this.dbci  = dbci;
     controller = new MainController(userDetails, userRights, this, dbci);
     mTileUserOwnDetail.Text = "Üdvözüljük " + userDetails.userLastName + " " +
                               userDetails.userFirstName + " Bejelentkezve mint " + userDetails.userAccountGroup;
 }
 public ServiceOrdBookArriveWinController(List <OrderingNoted> listNoted, Form parentOrdBookAriv,
                                          ServiceOrdering servOrd, SetOfUserDetails soud)
 {
     this.parentBookArrivWin = parentOrdBookAriv;
     this.servOrdering       = servOrd;
     this.soud   = soud;
     actWorkWith = RecordType.NOTED;
     catchControls();
     this.listNoted  = listNoted;
     labelTitle.Text = "Rendelési lista készítése";
     executeLoadInAllTheRecords();
 }
コード例 #13
0
        /// <summary>
        /// fills up the fields to help the user
        /// </summary>
        /// <param name="soud">details of the operator user</param>
        private void fillInTheBasicInfos(SetOfUserDetails soud)
        {
            textBoxStartDate.Text = DateTime.Today.Year + "." + DateTime.Today.Month + "." + DateTime.Today.Day;
            //textBoxFinalDate.Text = "";
            textBoxUserOrder.Text = soud.userLastName + " " + soud.userFirstName;
            //textBoxUserModif.Text = "";

            textBoxProdcode.Text    = "";
            textBoxOrdPlace.Text    = "";
            textBoxOrdAmount.Text   = "";
            textBoxSubcontr.Text    = "";
            checkBoxNewProd.Checked = true;
        }
コード例 #14
0
 /// <summary>
 /// ordering list PDF creation process
 /// </summary>
 /// <param name="listThatNeedToBePDF">the important record content of Noted</param>
 public void setChosenRecordsToPDF(SetOfUserDetails soud, List <OrderingNoted> listThatNeedToBePDF)
 {
     try
     {
         modelPDFCreate = new OrderingModellerPDF(soud, dbci.output, listThatNeedToBePDF);
     }
     catch (ErrorMigraDocFileCreation e)
     {
         throw new ErrorServiceOrdering(e.Message);
     }
     catch (Exception e)
     {
         throw new ErrorServiceOrdering("Ismertlen hiba történt (ServOrdPDFBooking) " + e.Message);
     }
 }
コード例 #15
0
        /// <summary>
        /// defines the steps when new ordering record is needed
        /// </summary>
        /// <param name="soud">details of operator-user</param>
        private void adjutTheFieldsWithProperDatas(SetOfUserDetails soud)
        {
            if (windoProcessMode == OrderingWindowPurpose.NEW)
            {
                adjustFieldsAsNewRecNeeds();
                fillInTheBasicInfos(soud);
                labelInfoBar.Text = "Új rendelési tétel bejegyzése";
                adjustFieldsNewBasicModify();
                adjustFieldsToChangeProdStrip();
                buttonOk.Text    = "Létrehozás";
                buttonOk.Visible = true;

                executeChooseModifyEvent();
            }
        }
コード例 #16
0
        /// <summary>
        /// define the header content of the healthcare-form
        /// </summary>
        /// <param name="name">the name of the person</param>
        /// <param name="taj">the taj-number of the person</param>
        private void adjustHeader(SetOfUserDetails userDet)
        {
            string headerText1 = "Rendelési lista";
            string headerText2 = userDet.userLastName + " " + userDet.userFirstName + " Beosztás: " + userDet.userPosition;

            thePage   = new Section();
            thePage   = doc.AddSection();
            paragraph = thePage.Headers.FirstPage.AddParagraph();        //this is a problematic line!!
            paragraph = thePage.AddParagraph();
            paragraph.AddFormattedText(headerText1, StyleNames.Header);
            paragraph.AddLineBreak();
            paragraph.AddFormattedText(headerText2, StyleNames.Header);
            paragraph.AddLineBreak();
            paragraph.AddFormattedText("Nyomtatás ideje: ", StyleNames.Header);
            paragraph.AddDateField();
            paragraph.AddLineBreak();
            paragraph.AddLineBreak();
        }
コード例 #17
0
        /// <summary>
        /// define the header content of the healthcare-form
        /// </summary>
        /// <param name="name">the name of the person</param>
        /// <param name="taj">the taj-number of the person</param>
        private void adjustHeader(SetOfUserDetails userDet)
        {
            string headerText1 = "Kémiai-egészségügyi adatlap";
            string headerText2 = userDet.userLastName + " " + userDet.userFirstName + " TAJ-szám: " + userDet.userTaj;

            thePage   = new Section();
            thePage   = doc.AddSection();
            paragraph = thePage.Headers.FirstPage.AddParagraph();        //this is a problematic line!!
            paragraph = thePage.AddParagraph();
            paragraph.AddFormattedText(headerText1, StyleNames.Header);
            paragraph.AddLineBreak();
            paragraph.AddFormattedText(headerText2, StyleNames.Header);
            paragraph.AddLineBreak();
            paragraph.AddFormattedText("Nyomtatás ideje: ", StyleNames.Header);
            paragraph.AddDateField();
            paragraph.AddLineBreak();
            paragraph.AddLineBreak();
        }
コード例 #18
0
        //it works with PDFSharp-MigraDoc-GDI by empria Software BmbH v. 1.32.4334
        public PersonalProfileModelPDFhc(SetOfUserDetails userDet, string pathOfOutput, List <string> chem,
                                         List <string[]> accid)
        {
            string filename = userDet.userLastName + "Adatlapja" + DateTime.Today.Year.ToString() +
                              DateTime.Today.Month.ToString() + DateTime.Today.Day.ToString() + ".pdf";
            int indexer = 0;

            try
            {
                if (!Directory.Exists(pathOfOutput))
                {
                    Directory.CreateDirectory(pathOfOutput);
                }
                while (File.Exists(pathOfOutput + filename))
                {
                    filename = "Rendeles_" + userDet.userLastName + "_"
                               + DateTime.Today.Year.ToString() + DateTime.Today.Month.ToString()
                               + DateTime.Today.Day.ToString() + "_" + indexer + ".pdf";
                    indexer++;
                }
            }
            catch (Exception e)
            {
                throw new ErrorMigraDocFileCreation("Probléma van a fájl nevével vagy elérésével (ModPersPDFfolder) "
                                                    + e.Message);
            }
            try
            {
                adjustPageMetaDatas(userDet);
                adjustHeader(userDet);
                addChemicalsToPDF(chem);
                addAccidentsToPDF(accid);
                addFooterToPDF();
                finishPDF(pathOfOutput, filename);
            }
            catch (Exception e)
            {
                throw new ErrorMigraDocFileCreation("Probléma van a fájl létrehozásával (ModPersPDF) "
                                                    + e.Message);
            }
        }
コード例 #19
0
        public OrderingModellerPDF(SetOfUserDetails userDet, string pathOfOutput,
                                   List <OrderingNoted> listThatNeedToBePDF)
        {
            string filename = "Rendeles_" + userDet.userLastName + "_" + DateTime.Today.Year.ToString() +
                              DateTime.Today.Month.ToString() + DateTime.Today.Day.ToString() + ".pdf";
            int indexer = 0;

            try
            {
                if (!Directory.Exists(pathOfOutput))
                {
                    Directory.CreateDirectory(pathOfOutput);
                }
                while (File.Exists(pathOfOutput + filename))
                {
                    filename = "Rendeles_" + userDet.userLastName + "_"
                               + DateTime.Today.Year.ToString() + DateTime.Today.Month.ToString()
                               + DateTime.Today.Day.ToString() + "_" + indexer + ".pdf";
                    indexer++;
                }
            }
            catch (Exception e)
            {
                throw new ErrorMigraDocFileCreation("Probléma van a fájl nevével vagy elérésével (ModOrdPDFfolder) "
                                                    + e.Message);
            }
            try
            {
                adjustPageMetaDatas(userDet);
                adjustHeader(userDet);
                addOrderingRecToPDF(listThatNeedToBePDF);
                addFooterToPDF();
                finishPDF(pathOfOutput, filename);
            }
            catch (Exception e)
            {
                throw new ErrorMigraDocFileCreation("Probléma van a fájl létrehozásával (ModOrdPDF) "
                                                    + e.Message);
            }
        }