コード例 #1
0
 /// <summary>
 /// consists of the data reading from xml file to gain connection infos
 /// </summary>
 public void readConnDatas()
 {
     try
     {
         List <string> attrib = new List <string>();
         XmlDocument   doc    = new XmlDocument();
         doc.Load(path);
         XmlNodeList nodelist = doc.SelectNodes("/Connection");
         foreach (XmlNode node in nodelist)
         {
             attrib.Add(node.SelectSingleNode("host").InnerText);
             attrib.Add(node.SelectSingleNode("port").InnerText);
             attrib.Add(node.SelectSingleNode("DBname").InnerText);
             attrib.Add(node.SelectSingleNode("user").InnerText);
             attrib.Add(node.SelectSingleNode("password").InnerText);
             attrib.Add(node.SelectSingleNode("pdfOutputOrders").InnerText);
             attrib.Add(node.SelectSingleNode("pdfInputSafeSheets").InnerText);
         }
         connDetails = new UserConnDetails(
             attrib[0], attrib[1], attrib[2], attrib[3], attrib[4], attrib[5],
             attrib[6]);
     }
     catch
     {
         throw new ErrorXmlFileRead("A kapcsolódási információk kiolvasása sikertelen!");
     }
 }
コード例 #2
0
 /// <summary>
 /// constructor for Unit-test
 /// </summary>
 /// <param name="ucd"></param>
 /// <param name="mode"></param>
 public ManageIOConnFileController(UserConnDetails ucd, bool mode)
 {
     try
     {
         modelManagIOConn = new ModelManageIOConnFile();
         if (mode)
         {
             modelManagIOConn.writeConnDatas(ucd);
         }
         else
         {
             modelManagIOConn.reviseXmlFileExists();
             modelManagIOConn.readConnDatas();
             userConnDetails = modelManagIOConn.getConnInfos();
         }
     }
     catch (ErrorXmlFileWrite e)
     {
         errorHandle(e.getMessage());
     }
     catch (ErrorXmlFileRead e)
     {
         errorHandle(e.getMessage());
     }
     catch (Exception)
     {
         errorHandle("Ismeretlen fájlkezelési hiba történt! Kapcsolódási információk betöltése megszakadt!");
     }
 }
コード例 #3
0
 public LogInController(Form loginWin)
 {
     this.parentLoginWindow = loginWin;
     dbInfosContoller       = new ManageIOConnFileController(parentLoginWindow);
     dbci = dbInfosContoller.getTheConnInfos();
     catchTheControls();
 }
コード例 #4
0
 /// <summary>
 /// constructor in case of user wants to change the DB conn. informations
 /// </summary>
 /// <param name="dbci">the old connection datas</param>
 /// <param name="parent">the login window</param>
 public FormAdjustConnectionWindow(UserConnDetails dbci, Form parent)
 {
     InitializeComponent();
     this.dbci   = dbci;
     this.parent = parent;
     parent.Hide();
     if (dbci == null)   //the case of missing xml or first run
     {
         dbci            = new UserConnDetails();
         mTxtBxHost.Text = "";
         mTxtBxPort.Text = "";
         mTxtBxUser.Text = "";
         mTxtBxPwd.Text  = "";
         mTxtBxDB.Text   = "";
     }
     else
     {
         mTxtBxHost.Text    = dbci.host;
         mTxtBxPort.Text    = dbci.port;
         mTxtBxUser.Text    = dbci.user;
         mTxtBxPwd.Text     = dbci.pwd;
         mTxtBxDB.Text      = dbci.db;
         mTxtBxPdfDest.Text = dbci.output;
         mTxtBxUrl.Text     = dbci.input;
     }
 }
コード例 #5
0
        /// <summary>
        /// consists of the data writting to xml file to save connection infos
        /// </summary>
        /// <param name="ucd"></param>
        public void writeConnDatas(UserConnDetails ucd)
        {
            try
            {
                using (XmlWriter writer = XmlWriter.Create(path))
                {
                    writer.WriteStartDocument();
                    writer.WriteStartElement("Connection");

                    writer.WriteElementString("host", ucd.host);
                    writer.WriteElementString("port", ucd.port);
                    writer.WriteElementString("DBname", ucd.db);
                    writer.WriteElementString("user", ucd.user);
                    writer.WriteElementString("password", ucd.pwd);
                    writer.WriteElementString("pdfOutputOrders", ucd.output);
                    writer.WriteElementString("pdfInputSafeSheets", ucd.input);

                    writer.WriteEndElement();
                    writer.WriteEndDocument();
                }
            }
            catch
            {
                throw new ErrorXmlFileWrite("A kapcsolódási információk nem menthetőek el!");
            }
        }
コード例 #6
0
 /// <summary>
 /// defines the process, when the DB connection window is needed
 /// </summary>
 public void startManageConnDetails()
 {
     ajdustDBconn = new FormAdjustConnectionWindow(dbci, parentLoginWindow);
     if (ajdustDBconn.ShowDialog() == DialogResult.OK)
     {
         dbci = dbInfosContoller.getTheConnInfos();
     }
 }
コード例 #7
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);
 }
コード例 #8
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();
 }
コード例 #9
0
 public MainController(SetOfUserDetails soud, SetOfUserRights sour, Form parentalMainWindow, UserConnDetails dbci)
 {
     this.mainWindow       = parentalMainWindow;
     this.setOfUserDetails = soud;
     this.dbci             = dbci;
     initializeMainWindowElementsByRightsOfUser(sour);
     catchTheControlsOfServices();
 }
コード例 #10
0
 /// <summary>
 /// constructor of the rights manager window
 /// </summary>
 /// <param name="parent">address of the parent main</param>
 /// <param name="rightToModify">rights of read or modify</param>
 /// <param name="dbci">DB connection informations</param>
 public FormServiceRightsWindow(Form parent, bool rightToModify, UserConnDetails dbci)
 {
     InitializeComponent();
     rightsController      = new ServiceRightsWinController(dbci, rightToModify, this);
     this.parentMainWindow = parent;
     this.Show();
     parentMainWindow.Hide();
     rightsController.fillUpMainComboBox();
 }
コード例 #11
0
 /// <summary>
 /// saves and write to xmlfile the mTextboxes data for connection
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void mTileSaveConData_Click(object sender, EventArgs e)
 {
     dbci = new UserConnDetails(mTxtBxHost.Text, mTxtBxPort.Text, mTxtBxDB.Text, mTxtBxUser.Text,
                                mTxtBxPwd.Text, mTxtBxPdfDest.Text, mTxtBxUrl.Text);
     controllerDBInfos = new ManageIOConnFileController(this);
     controllerDBInfos.setTheConnInfos(dbci);
     parent.Show();
     this.Close();
 }
コード例 #12
0
 /// <summary>
 /// tries to find DB connection informations in the object - is needed in the login-controller
 /// </summary>
 /// <param name="dbci">the connection-info carrier</param>
 /// <returns>needness of asking connection parameters by user</returns>
 public bool initialDBConnectInfo(UserConnDetails dbci)
 {
     if (dbci == null)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #13
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;
 }
コード例 #14
0
        /// <summary>
        /// coordinates the connection end communicarions with the DB under MetroWinForm environment
        /// with the needed connection datas - all must have at least "" content
        /// </summary>
        /// <param name="host">host adress</param>
        /// <param name="port">port number</param>
        /// <param name="database">managed DB name</param>
        /// <param name="user">uername to enter with</param>
        /// <param name="pwd">password to enter with</param>
        /// <param name="consoleErr">is needed console based errors?</param>
        /// <param name="oldFormErr">is needed old WinForm errors?</param>
        /// <param name="metroFormErr">is needed Metro WinFrom errors?</param>
        /// <param name="parentForm">the parent MetroWindow</param>
        /// <returns>MySqlInterface with basic adjusts</returns>
        public InterfaceMySQLDBChannel kapcsolodas(UserConnDetails dbci, System.Windows.Forms.Form parent)
        {
            InterfaceMySQLDBChannel mdi = new InterfaceMySQLDBChannel();

            mdi.setErrorToUserInterface(true);                          //ha hiba van, megjeleni - konzolos
            mdi.setErrorToGraphicalUserInterface(true);                 //ha hiba van, megjeleni - régebbi Form verzióban
            mdi.setErrorToMetroGraphicalUserInterface(true, parent);    //ha hiba van, megjeleníti - újabb MetroForm-ban
            mdi.setConnectionServerData(dbci.host, dbci.db, dbci.port); //hely, adatbázis neve, portja
            mdi.setConnectionUserData(dbci.user, dbci.pwd);             //admin név, jelszava
            mdi.makeConnectionToDatabase();                             //beállítja az alap kapcsolódási adatokat
            return(mdi);
        }
コード例 #15
0
        /// <summary>
        /// writes out the connection infos - it is needed the adjustwindow controller
        /// </summary>
        /// <param name="ucd">the proper details to XML files</param>
        public void setTheConnInfos(UserConnDetails ucd)
        {
            try
            {
                modelManagIOConn.writeConnDatas(ucd);
            }

            catch (ErrorXmlFileWrite e)
            {
                errorHandle(e.getMessage());
            }
            catch (Exception)
            {
                errorHandle("Ismeretlen fájlkezelési hiba történt! Kapcsolódási információk betöltése megszakadt!");
            }
        }
コード例 #16
0
 /// <summary>
 /// read the connection details of xml file to have DB connection
 /// </summary>
 /// <param name="ucd"></param>
 public UserConnDetails getTheConnInfos()
 {
     try
     {
         modelManagIOConn.reviseXmlFileExists();
         modelManagIOConn.readConnDatas();
         userConnDetails = modelManagIOConn.getConnInfos();
     }
     catch (ErrorXmlFileRead e)
     {
         errorHandle(e.getMessage());
     }
     catch (Exception e)
     {
         errorHandle("Ismeretlen hiba történt! Kapcsolódási információk betöltése megszakadt! " + e.Message);
     }
     return(userConnDetails);
 }
コード例 #17
0
 /// <summary>
 /// constructor of the RightsWindowController
 /// </summary>
 /// <param name="dbci">DB connection informations</param>
 /// <param name="rightToModify">RightLevel of the user</param>
 /// <param name="parentRightsWin">parent window</param>
 public ServiceRightsWinController(UserConnDetails dbci, bool rightToModify, Form parentRightsWin)
 {
     this.parRightsWindow     = parentRightsWin;
     this.rightToModifyGroups = rightToModify;
     try
     {
         serviceRights = new ServiceRights(dbci, parentRightsWin);   //the list of RightGroups is build here
     }
     catch (ErrorServiceRights e)
     {
         errorHandleError(e.Message);
     }
     actMode = ModeOfRightsManage.VIEW;
     catchControllers();
     if (rightToModify)
     {
         enableModifyTiles();
     }
 }
コード例 #18
0
 public ServiceOrdering(UserConnDetails dbci, Form parent, string userId)
 {
     this.parentMainWin    = parent;
     this.dbci             = dbci;
     this.userIdOfOperator = userId;
 }
コード例 #19
0
 public RequestsModelWirteOut(UserConnDetails dbci, Form parent)
 {
     startDB = new InterfaceMySQLStartDBConnect();
     mdi     = startDB.kapcsolodas(dbci, parent);
 }
コード例 #20
0
 public ServiceProducts(UserConnDetails dbci, Form parent, string userId)
 {
     this.parent = parent;
     this.dbci   = dbci;
     this.userId = userId;
 }
コード例 #21
0
 public ServiceRequests(UserConnDetails dbci, Form parentMain, string userIdOfPoerator)
 {
     this.dbci             = dbci;
     this.parent           = parentMain;
     this.userIdOfPoerator = userIdOfPoerator;
 }
コード例 #22
0
 public ProductsModelReadIn(UserConnDetails dbci, Form parent)
 {
     startDB = new InterfaceMySQLStartDBConnect();
     mdi     = startDB.kapcsolodas(dbci, parent);
 }
コード例 #23
0
 /// <summary>
 /// constructor of personal profile manager control
 /// </summary>
 /// <param name="dbci">the details of DB connections</param>
 /// <param name="parent">the window form</param>
 public ServiceProfileManage(UserConnDetails dbci, Form parent)
 {
     this.dbci   = dbci;
     this.parent = parent;
 }