示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session[Macros.SESSION_KEY].ToString() == "" || Session[Macros.SESSION_KEY].ToString() == null)
                {
                    Response.Redirect("Default.aspx");
                }
                else
                {
                    if (Request.QueryString.Get("skey") == "" || Request.QueryString.Get("skey") == null)
                    {
                        Response.Redirect("Default.aspx");
                    }
                    else
                    {
                        Queryparam = Cryptography.GetK_Decrypt(Request.QueryString.Get("skey").ToString());
                        string[] session_arr = Session[Macros.SESSION_KEY].ToString().Split(',');
                        bool     bcheck      = false;

                        if (Convert.ToInt32(session_arr[0]) == Macros.iSUPER_ADMIN)
                        {
                            bcheck = DB_Querys.IsSitekeyAvailable(Queryparam);
                        }
                        else
                        {
                            bcheck = DB_Querys.IsSitekeyAvailable(Queryparam, session_arr[session_arr.Length - 1]);
                        }



                        if (bcheck)
                        {
                            //
                        }
                        else
                        {
                            Response.Redirect("Default.aspx");
                        }
                    }
                }
            }
            catch
            {
                Response.Redirect("Default.aspx");
            }
        }
        /* protected void btn_Click(object sender, EventArgs e)
         * {
         *  // Button btn = (Button)sender;
         *   HtmlInputButton btn = (HtmlInputButton)sender;
         *   string str = btn.ID;
         * }*/



        protected void Page_Load(object sender, EventArgs e)
        {
            //btn1.ServerClick += new EventHandler(btn_Click);
            try
            {
                GTICLOUD.navbar.dropstring = "";
                string skey = Cryptography.GetK_Decrypt(Request.QueryString.Get("skey").ToString());

                string[] session_arr = Session[Macros.SESSION_KEY].ToString().Split(',');
                sFileInfo = DB_Querys.GetFileConfigId(Convert.ToInt32(skey));

                try
                {
                    if (Session[Macros.SESSION_KEY].ToString() == "" || Session[Macros.SESSION_KEY].ToString() == null)
                    {
                        if (Convert.ToInt32(session_arr[0]) == Macros.iSUPER_ADMIN)
                        {
                            Response.Redirect("Default.aspx");
                        }
                        else
                        {
                            Response.Redirect("authenticate.aspx");
                        }
                    }
                    else
                    {
                        //get all data accornding Session[Macros.SESSION_SITE_KEY].ToString()

                        //  Response.Write("<h3>"+heddinfld.Value+"</h3>");
                        string st = skey;
                        //string[] session_arr = Session[Macros.SESSION_KEY].ToString().Split(',');
                        sitekey = Convert.ToInt32(st);
                        bool bcheck = false;

                        if (Convert.ToInt32(session_arr[0]) == Macros.iSUPER_ADMIN)
                        {
                            bcheck = DB_Querys.IsSitekeyAvailable(st);
                        }
                        else
                        {
                            bcheck = DB_Querys.IsSitekeyAvailable(st, session_arr[session_arr.Length - 1]);
                        }
                        if (bcheck)
                        {
                            //
                        }
                        else
                        {
                            if (Convert.ToInt32(session_arr[0]) == Macros.iSUPER_ADMIN)
                            {
                                Response.Redirect("Default.aspx");
                            }
                            else
                            {
                                Response.Redirect("authenticate.aspx");
                            }
                        }
                        //int view = (Convert.ToInt32(st.ToCharArray()[0]) - 33);

                        //   Response.Write("<h3>" + st + "</h3>");
                        GTICLOUD.navbar.dropstring += "  <li><a href='#!'>Settings</a></li>";
                        GTICLOUD.navbar.dropstring += "  <li><a href='#!'>Logout</a></li>";
                    }

                    string permission_level = session_arr[0];
                    string mailId           = session_arr[1];
                    int    FileId           = 0;
                    if (sFileInfo == "")
                    {
                        FileId = 0;
                        ConfigLinkBtn.Visible = false;
                    }
                    else
                    {
                        FileId = Convert.ToInt32(sFileInfo.Split(',')[0]);
                    }

                    ArrayList VerifyArr = DB_Querys.IsVerifiedByAdmin(sitekey, permission_level, mailId, FileId);

                    if (VerifyArr[0].Equals(true) && VerifyArr[1].Equals(false))
                    {
                        ProcessLabel.Visible  = false;
                        NowDownload.Visible   = true;
                        download_msg.Visible  = false;
                        ConfigLinkBtn.Visible = false;
                        refresh.Visible       = false;
                    }
                    if (VerifyArr[0].Equals(false) && VerifyArr[1].Equals(true))
                    {
                        ProcessLabel.Visible  = true;
                        NowDownload.Visible   = false;
                        ConfigLinkBtn.Visible = false;
                        download_msg.Visible  = true;
                        refresh.Visible       = true;
                    }
                }
                catch (Exception ex)
                {
                    if (Convert.ToInt32(session_arr[0]) == Macros.iSUPER_ADMIN)
                    {
                        Response.Redirect("Default.aspx");
                    }
                    else
                    {
                        Response.Redirect("authenticate.aspx");
                    }
                }
            }
            catch
            {
                Response.Redirect("Default.aspx");
            }
        }