Пример #1
0
    public bool DeleteData(object obj, string prameter)
    {
        //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('Are you sure you want to delete?')){DeleteData1();}else{}</script>");
        int    row        = 0;
        bool   isSelected = false;
        string deletStr   = "select * from TopoTestControl  where IgnoreFlag='False'and PID=" + moduleTypeID + "ORDER BY SEQ";

        try
        {
            for (int i = 0; i < TestplanFlowControlList.Length; i++)
            {
                ASCXFlowControlList cb = (ASCXFlowControlList)FlowControlList.FindControl(TestplanFlowControlList[i].ID);
                if (cb != null)
                {
                    if (cb.BeSelected == true)
                    {
                        row++;
                        isSelected = true;
                        //mydt.Rows[i].Delete();
                        mydt.Rows[i]["IgnoreFlag"] = true;
                    }
                }
                else
                {
                    Response.Write("<script>alert('can not find user control!');</script>");
                    return(false);
                }
            }
            if (isSelected == false)
            {
                //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('Did not choose any one!');return false;</script>");
                this.Page.RegisterStartupScript("", "<script>alert('Did not choose any one!');</script>");
                //Response.Write("<script>alert('Did not choose any one!');</script>");
                return(false);
            }
            int result = pDataIO.UpdateWithProc("TopoTestControl", mydt, deletStr, logTracingString);
            if (result > 0)
            {
                mydt.AcceptChanges();
            }
            else
            {
                pDataIO.AlertMsgShow("Update data fail!");
            }
            Response.Redirect(Request.Url.ToString());
            return(true);
        }
        catch (System.Exception ex)
        {
            throw ex;
        }
    }
Пример #2
0
    public bool CopyData(object obj, string prameter)
    {
        bool   isSelected   = false;
        int    selectCount  = 0;
        string copySourceID = "";

        try
        {
            for (int i = 0; i < TestplanFlowControlList.Length; i++)
            {
                ASCXFlowControlList cb = (ASCXFlowControlList)FlowControlList.FindControl(TestplanFlowControlList[i].ID);
                if (cb != null)
                {
                    if (cb.BeSelected == true)
                    {
                        selectCount++;
                        isSelected   = true;
                        copySourceID = cb.LinkBItemNameID;
                    }
                }
                else
                {
                    Response.Write("<script>alert('can not find user control!');</script>");
                    return(false);
                }
            }
            if (isSelected == false || selectCount > 1)
            {
                //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('Did not choose any one!');return false;</script>");
                this.Page.RegisterStartupScript("", "<script>alert('please choose one only!');</script>");
                //Response.Write("<script>alert('Did not choose any one!');</script>");
                return(false);
            }

            Response.Redirect("~/WebFiles/TestPlan/CopyFlowControl.aspx?uId=" + moduleTypeID.Trim() + "&sourceID=" + copySourceID);
        }
        catch (System.Exception ex)
        {
            throw ex;
        }
        return(true);
    }
Пример #3
0
    public bool updateData(object obj, string parameters)
    {
        string tempLPSEQText = "";

        try
        {
            ASCXFlowControlList fc = (ASCXFlowControlList)FlowControlList.FindControl(Convert.ToString(obj));
            tempLPSEQText = fc.ID;
            if (fc != null)
            {
                if (parameters == "True")
                {
                    if (Convert.ToInt64(tempLPSEQText) <= 0)
                    {
                        return(true);
                    }
                    else
                    {
                        for (int i = 0; i < TestplanFlowControlList.Length; i++)
                        {
                            if (TestplanFlowControlList[i].ID == fc.ID)
                            {
                                if (i <= 0)
                                {
                                    return(true);
                                }
                                else
                                {
                                    if (Convert.ToUInt32(mydtProcess.Rows[i]["SEQ"]) <= 1)
                                    {
                                        return(true);
                                    }
                                    Label finLB  = (Label)tableFC.FindControl("SEQ" + fc.ID);
                                    Label finLB1 = (Label)tableFC.FindControl("SEQ" + TestplanFlowControlList[i - 1].ID);
                                    if (finLB != null && finLB1 != null)
                                    {
                                        string temptext = finLB.Text;
                                        finLB.Text  = finLB1.Text;
                                        finLB1.Text = temptext;
                                    }
                                    //mydt.Rows[i]["SEQ"] = mydt.Rows[i - 1]["SEQ"];
                                    //mydt.Rows[i-1]["SEQ"] = fc.LbSEQText;
                                    //TestplanFlowControlList[i].LbSEQText = TestplanFlowControlList[i - 1].LbSEQText;
                                    //TestplanFlowControlList[i - 1].LbSEQText = tempLPSEQText;
                                    //string cmdString = "select * from TopoTestControl  where PID=" + moduleTypeID + "ORDER BY SEQ";
                                    //pDataIO.UpdateDataTable(cmdString, mydt);
                                    //Response.Redirect(Request.Url.ToString());
                                }
                            }
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < TestplanFlowControlList.Length; i++)
                    {
                        if (TestplanFlowControlList[i].ID == fc.ID)
                        {
                            if (i >= rowCount - 1)
                            {
                                return(true);
                            }
                            else
                            {
                                Label finLB  = (Label)tableFC.FindControl("SEQ" + fc.ID);
                                Label finLB1 = (Label)tableFC.FindControl("SEQ" + TestplanFlowControlList[i + 1].ID);
                                if (finLB != null && finLB1 != null)
                                {
                                    string temptext = finLB.Text;
                                    finLB.Text  = finLB1.Text;
                                    finLB1.Text = temptext;
                                }
                                //mydt.Rows[i]["SEQ"] = mydt.Rows[i +1]["SEQ"];
                                //mydt.Rows[i +1]["SEQ"] = fc.LbSEQText;
                                //TestplanFlowControlList[i].LbSEQText = TestplanFlowControlList[i + 1].LbSEQText;
                                //TestplanFlowControlList[i + 1].LbSEQText = tempLPSEQText;
                                //string cmdString = "select * from TopoTestControl  where PID=" + moduleTypeID + "ORDER BY SEQ";
                                //pDataIO.UpdateDataTable(cmdString, mydt);
                                //mydt.Clear();
                                //mydt = pDataIO.GetDataTable("select * from TopoTestControl  where PID=" + moduleTypeID + "ORDER BY SEQ", "TopoTestControl");
                                //Response.Redirect(Request.Url.ToString());
                            }
                        }
                    }
                }
                this.FlowControlList.Controls.Clear();
                PostBackData();
                return(true);
            }
            else
            {
                Response.Write("<script>alert('can not find user control!');</script>");
                return(false);
            }
        }
        catch (System.Exception ex)
        {
            throw ex;
        }
    }