コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Guid id = new Guid(Request.QueryString["id"]);

            // Check the thread result collection
            if (ThreadResults.Contains(id) && ThreadResults.message == "")
            {
                // The worker thread has finished

                // Get the result from the thread result collection
                //int authorizationId = (int)ThreadResults.Get(id);
                DataTable dt = (DataTable)ThreadResults.Get(id);

                // Remove the result from the collection
                ThreadResults.Remove(id);

                lblMessage.Text      = "انتهى حساب قرارات الصيانة بنجاح";
                lblMessage.ForeColor = Color.Green;
                hlnkClose.Visible    = true;

                gvSectionMaintenanceDecisions.DataSource = dt;
                gvSectionMaintenanceDecisions.DataBind();

                //UdiShared.StartShapeFileAutoCreationProgram();
            }
            else
            {
                if (ThreadResults.message == "")
                {
                    lblMessage.Text      = "يجري الآن حساب حالة الرصف وقرارات الصيانة ، الرجاء الانتظار";
                    lblMessage.ForeColor = Color.Black;

                    Response.AddHeader("Refresh", "2");
                }
                else
                {
                    lblMessage.Text       = ThreadResults.message;
                    ThreadResults.message = "";
                    hlnkClose.Visible     = true;
                }
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text   = ex.Message;
            hlnkClose.Visible = true;
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Guid id = new Guid(Request.QueryString["id"]);

            // Check the thread result collection
            if (ThreadResults.Contains(id))
            {
                // The worker thread has finished

                // Get the result from the thread result collection
                //int authorizationId = (int)ThreadResults.Get(id);
                DataTable dt = (DataTable)ThreadResults.Get(id);

                // Remove the result from the collection
                ThreadResults.Remove(id);

                lblMessage.Text      = "انتهى حساب حالة الرصف بنجاح";
                lblMessage.ForeColor = Color.Green;

                UdiShared.StartShapeFileAutoCreationProgram();
            }
            else
            {
                lblMessage.Text      = "يجري الآن حساب حالة الرصف، الرجاء الانتظار";
                lblMessage.ForeColor = Color.Black;

                Response.AddHeader("Refresh", "2");
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text = ex.Message;
        }
    }