Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var userID = Session["userID"];

            if (userID == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                ViewState["userID"] = userID;
            }

            /////////////////////////////////////////////////////////////////////

            var regId = Session["registerID"];
            ChancelerryDBDataContext dataContext = new ChancelerryDBDataContext();
            TableActions             ta          = new TableActions();

            var register =
                (from r in dataContext.Registers
                 where r.registerID == Convert.ToInt32(regId)
                 select r).FirstOrDefault();


            if (register != null)
            {
                RegisterNameLabel.Text = register.name;


                if (vVersion)
                {
                    int size = 100;
                    if (Request.QueryString["page"] != null)
                    {
                        Int32.TryParse(Request.QueryString["page"], out page);
                    }

                    Dictionary <int, string> vSearchList         = (Dictionary <int, string>)Session["vSearchList"];
                    CardCommonFunctions      cardCommonFunctions = new CardCommonFunctions();

                    string sum = cardCommonFunctions.FastSearch(vSearchList, register.registerID, Convert.ToInt32(userID), dataTable, page * size, (page + 1) * size);
                    Button5.Visible        = true;
                    Button6.Visible        = true;
                    Button7.Visible        = false;
                    Button8.Visible        = false;
                    BottomButton9.Visible  = false;
                    BottomButton10.Visible = true;
                    BottomButton11.Visible = true;
                    BottomButton12.Visible = false;
                    string page_info = sum;
                    PageNumberLabel.Text       = page_info;
                    BottomPageNumberLabel.Text = page_info;
                }
                else
                {
                    ta.RefreshTable(dataContext, Convert.ToInt32(ViewState["userID"]), register, regId, dataTable, (Dictionary <int, string>)Session["vSearchList"]);
                    TableActions.DTable = dataTable;


                    string page_info = "Cтраница: " + ((int)Session["pageCntrl"] + 1).ToString() + "/" + (int)Session["pageCount"] + ". Всего: " + (int)Session["cardsCount"];
                    PageNumberLabel.Text       = page_info;
                    BottomPageNumberLabel.Text = page_info;
                }
            }
        }