Exemple #1
0
        public frmMain()
        {
            InitializeComponent();
            try
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("select 49 OENR, 'OM Team Wien 1' OEBEZ, 'OFM W1' OE_KURZBEZ, ");
                sb.AppendLine("'OFM W1' || substr(username, instr(username, '_')) ARBEITSGRUPPE ");
                sb.AppendLine("from mitarbeiter where username like 'W1%' and ist_rolle = 1 and status = 0 ");
                sb.AppendLine("order by 1");
                txtWGStatement.Text = sb.ToString();

                txtUserStatement.Text = "select USERNR, USERNAME from mitarbeiter where usernr = 11";

                CCDGUI.ccdLogin login = new CCDGUI.ccdLogin();
                if (login.DoLogin())
                {
                    Session = login.Session;
                    SCBWflRows rows = Session.SQLCommand(USER_CODE, "select value from BIG_CONNECTION_STRING");
                    foreach (SCBWflRow row in rows)
                    {
                        ConnectionString = row.ToString();
                        oracleConnection = new oraClient.OracleConnection(ConnectionString);
                        oracleConnection.Open();
                    }
                }
                else
                {
                    this.Close();
                }
                rbSelectUser.Checked = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error in frmMain()", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        public frmMain()
        {
            InitializeComponent();
            assem         = typeof(frmMain).Assembly;
            Console.Title = assem.FullName;
            CCDGUI.ccdLogin login = new CCDGUI.ccdLogin();
            if (login.DoLogin())
            {
                try
                {
                    Console.WriteLine("\n...KONFIGURATION WIRD GELADEN...");
                    logger          = new Logger();
                    logger.Filename = string.Format("{0}{1}_{2}.csv", AppDomain.CurrentDomain.BaseDirectory, System.Diagnostics.Process.GetCurrentProcess().ProcessName, DateTime.Now.ToString("yyyyMMddhhmmss"));
                    Cursor.Current  = Cursors.WaitCursor;
                    sysSession      = new SCBWflSession();
                    sysSession.ConnectServer(login.Session.HostName, login.Session.PortNo);
                    sysSession.SystemLogin(APP_CODE, PRODUCT_ID);

                    lblDOMEAConnection.Text = sysSession.HostName + ";" + sysSession.PortNo;

                    ora = new OracleHelper(DomeaConfiguration.GetOracleConnectionString(sysSession));
                    ora.OpenConnection();

                    dgvBIG_FOLDER_RESTORE_TMP.DataSource = bindingSource1;

                    /*
                     * string stmt = "select distinct f.tmp_ID ID, g.igz, g.gz, f.wgnr, f.wgname, f.PFAD_GESAMT, f.folderbez, f.FOLDERNR, f.VATER_FOLDERBEZ, f.PATH STATUS " +
                     *          "from BIG_FOLDER_RESTORE_TMP f, gst g " +
                     *          "where f.foldernr >= 0 " +
                     *            "and g.gz = f.gz " +
                     *            "and f.wgnr = f.usernr " +
                     *          //"order by f.pfad_gesamt";
                     *          "order by f.tmp_ID";
                     *
                     * string stmt = "select distinct f.tmp_ID ID, g.igz, g.gz, f.wgnr, f.wgname, f.PFAD_GESAMT, f.PFAD, f.folderbez, f.FOLDERNR, f.VATER_FOLDERBEZ, f.PATH STATUS, " +
                     *                             "m.DESTINATION_ID, m.DESTINATION_NAME, m.DESTINATION_NAME || '\' || f.PFAD PFAD_NEU " +
                     *              "from BIG_FOLDER_RESTORE_TMP f, gst g, V_BIG_WORKGROUP_OLD_NEW m  " +
                     *              "where f.foldernr >= 0  " +
                     *              "and g.gz = f.gz  " +
                     *              "and f.wgnr = f.usernr  " +
                     *              "and m.source_id = f.wgnr " +
                     *              "order by f.tmp_ID";
                     */
                    string stmt = "select distinct f.tmp_ID ID, g.igz, g.gz, f.wgnr, f.wgname, f.PFAD_GESAMT, f.PFAD, f.folderbez, f.FOLDERNR, f.VATER_FOLDERBEZ, f.PATH STATUS, " +
                                  "m.DESTINATION_ID, m.DESTINATION_NAME, m.DESTINATION_NAME || '\\' || f.PFAD PFAD_NEU " +
                                  "from BIG_FOLDER_RESTORE_TMP f, gst g, V_BIG_WORKGROUP_OLD_NEW m  " +
                                  "where trim(f.path) is null " +    // nur solche die noch nicht verarbeitet wurden
                                  "and f.foldernr >= 0  " +
                                  "and g.gz = f.gz  " +
                                  "and f.wgnr = f.usernr  " +
                                  "and m.source_id = f.wgnr " +
                                  "order by f.tmp_ID";

                    //bindingSource1.DataSource = ora.GetData(stmt);

                    //dgvBIG_FOLDER_RESTORE_TMP.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(dgvBIG_FOLDER_RESTORE_TMP_DataBindingComplete);

                    dgvBIG_FOLDER_RESTORE_TMP.DataSource = ora.GetData(stmt);

                    DataCount      = dgvBIG_FOLDER_RESTORE_TMP.Rows.Count;
                    Tab2Loaded     = false;
                    Cursor.Current = Cursors.Default;
                }
                catch (Exception ex)
                {
                    Cursor.Current = Cursors.Default;
                    MessageBox.Show(ex.Message);
                    this.Close();
                }
            }
            else
            {
                this.Close();
            }
        }