Пример #1
0
        private void InitialLogin()
        {
            ConnectionToDB myconn = new ConnectionToDB();
            DataTable      MyDataTable;

            MyDataTable = myconn.GetDataTable("select Instance_name From sys.V_$INSTANCE");

            this.Text = this.Text + " @ " + MyDataTable.Rows[0][0].ToString();

            foreach (RibbonTab ribonTab in sowaidribbon.Tabs)
            {
                ribonTab.Visible = false;
            }

            //***************888

            Rectangle rect = Screen.FromHandle(this.Handle).WorkingArea;

            rect.Location        = new Point(0, 0);
            this.MaximizedBounds = rect;
            this.WindowState     = FormWindowState.Maximized;
            Theme.ColorTable     = new sowaidRibbonRendererColorTableBlack();
            //***********
            //pnlToolBar.Width = splitContainer2.Width / 3 * 2;
            //pnlToolBar.Left = splitContainer2.Width - pnlToolBar.Width;
            //pnlToolBar.Height = splitContainer2.Panel1.Height;
            //pnlToolBar.Top = 0;
            splitContainer2.SplitterWidth    = 1;
            splitContainer2.SplitterDistance = sowaidribbon.Height;


            // pbxSowaidLogo.Height = splitContainer2.Panel1.Height + 10;
            pbxLogo.Left = 0;
            pbxLogo.Top  = 27;


            //tmrCurrentTime.Start();
            // lblUserLable.Text = "اسم المستخدم : .....";
            //glb_function.glb_strUserName = "";
            // lblUserLable.Left = pnlRight.Width / 2 - lblUserLable.Width / 2;
            RemoveUserToolIcons();



            frmLogin myform = new frmLogin();

            myform.ShowDialog(this);



            //if (glb_function.glb_strUserName == "")
            //{
            //    this.Close();
            //    return;
            //}

            lblUserLable.Text = "     " + glb_function.glb_strUserName;
            // lblUserLable.Left = pbxLogout.Left + lblUserLable.Width -50;
            //lblUserLable.Top = pbxLogout.Top;


            ConnectionToDB cnn = new ConnectionToDB();

            //dtUserForm = cnn.GetDataTable("select p.swid,m.form_name,m.form_type from models_file m " +
            //      "   join privilege_file p on(m.swid = p.model_no and user_no = " + glb_function.glb_strUserId + ")" +
            //         "   union all" +
            //          "  select p.swid, m.form_name, m.form_type from models_account m" +
            //           " join privilege_account p on (m.swid = p.model_no and user_no = " + glb_function.glb_strUserId + ")" +
            //            "   union all" +
            //            " select p.swid,m.form_name,m.form_type from MODELS_CHARITIES m " +
            //      "   join PRIVILEGE_CHARITIES p on(m.swid = p.model_no and user_no = " + glb_function.glb_strUserId + ")" +
            //           "");

            dtUserForm = cnn.GetDataTable("select u.swid,m.form_name,m.form_eng_name,m.form_type from templet_header m,user_templet u " +
                                          " where m.swid = u.templet_id and u.user_id= " + glb_function.glb_strUserId);
            CreateToolIcons(this);
        }