protected void Button1_Click(object sender, EventArgs e)
    {
        String objrefname      = Request.Form["objrefname"].ToString();
        String Status          = Request.Form["Status"].ToString();
        String selectedproject = Request.Form["activeProject"].ToString();
        String Des             = Request.Form["des"].ToString();
        String value           = Request.Form["value"].ToString();
        String Modifiable      = Request.Form["Modifiable"].ToString();
        String global          = Request.Form["global"].ToString();
        int    projectid       = 0;

        value = value.Replace("'", "''");
        value = value.Replace("\r\n", string.Empty);
        value = value.Trim().ToString();
        //lblresult.Text = "";
        DataSet ds    = null;
        int     check = 0;

        if (objrefname != "" && value != "")
        {
            duplicatecheck = "select * from obj_repository where obj_ref_name = '{0}' and projectid= {1}";

            qry = string.Format(duplicatecheck, objrefname, selectedproject);



            if (obj.getDs(qry, out ds, "dsdt"))
            {
                if (ds.Tables[0].Rows.Count == 0)
                {
                    ispresent = true;
                }
            }
            qry = string.Format(insertobjectrepo, selectedproject, objrefname, value, Des, Status, global, Modifiable);
            if (ispresent == true)
            {
                if (obj.insert(qry, out temp))
                {
                    if (temp == 1)
                    {
                        // lblresult.Text = " " + txttestcase.Text.ToString() + " Testcase created sucessfully";
                        Response.Write("<script LANGUGE='JavaScript'> alert('" + objrefname + " Obj Repository created sucessfully  ')</script>");
                    }
                    else
                    {
                        Response.Write("<script LANGUGE='JavaScript'> alert('Error in creating new object referance name')</script>");
                    }
                }
            }
            else
            {
                Response.Write("<script LANGUGE='JavaScript'> alert('" + objrefname + " name already exists  ')</script>");
            }
        }
        else
        {
            Response.Write("<script LANGUGE='JavaScript'> alert('please select language and test case name')</script>");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        String actionname      = Request.Form["actiontype"].ToString();
        String Status          = Request.Form["Status"].ToString();
        String selectedproject = Request.Form["activeProject"].ToString();
        String Des             = Request.Form["des"].ToString();
        String exitiffail      = Request.Form["exit"].ToString();
        String Modifiable      = Request.Form["Modifiable"].ToString();
        String global          = Request.Form["global"].ToString();


        //lblresult.Text = "";
        DataSet ds = null;


        if (actionname != "" && selectedproject != "")
        {
            duplicatecheck = "select * from actiontype where actiontypename = '{0}' and projectid= {1}";

            qry = string.Format(duplicatecheck, actionname, selectedproject);



            if (obj.getDs(qry, out ds, "dsdt"))
            {
                if (ds.Tables[0].Rows.Count == 0)
                {
                    ispresent = true;
                }
            }
            qry = string.Format(inseractiontype, selectedproject, actionname, Des, global, Modifiable, exitiffail, Status);

            if (ispresent == true)
            {
                if (obj.insert(qry, out temp))
                {
                    if (temp == 1)
                    {
                        // lblresult.Text = " " + txttestcase.Text.ToString() + " Testcase created sucessfully";
                        Response.Write("<script LANGUGE='JavaScript'> alert('" + actionname + " Action type created sucessfully  ')</script>");
                    }
                    else
                    {
                        Response.Write("<script LANGUGE='JavaScript'> alert('Error in creating new action type name')</script>");
                    }
                }
            }
            else
            {
                Response.Write("<script LANGUGE='JavaScript'> alert('" + actionname + " name already exists  ')</script>");
            }
        }
        else
        {
            Response.Write("<script LANGUGE='JavaScript'> alert('please select action and project name')</script>");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        String testcasename = Request.Form["Testcasename"].ToString();
        String language     = Request.Form["language"].ToString();
        String Des          = Request.Form["des"].ToString();
        String Status       = Request.Form["Status"].ToString();
        String Priority     = Request.Form["Priority"].ToString();

        //lblresult.Text = "";
        DataSet ds    = null;
        int     check = 0;

        if (testcasename != "" && language != "")
        {
            duplicatecheck = "select * from testcases where testcasename = '{0}'";

            qry = string.Format(duplicatecheck, testcasename);



            if (obj.getDs(qry, out ds, "dsdt"))
            {
                if (ds.Tables[0].Rows.Count == 0)
                {
                    ispresent = true;
                }
            }
            qry = string.Format(inserttestcase, testcasename, Des, Status, language, Priority, activeprojectname);
            if (ispresent == true)
            {
                if (obj.insert(qry, out temp))
                {
                    if (temp == 1)
                    {
                        // lblresult.Text = " " + txttestcase.Text.ToString() + " Testcase created sucessfully";
                        Response.Write("<script LANGUGE='JavaScript'> alert('" + testcasename + " Test Case created sucessfully  ')</script>");
                    }
                    else
                    {
                        Response.Write("<script LANGUGE='JavaScript'> alert('Error in creating new testcase')</script>");
                    }
                }
            }
            else
            {
                Response.Write("<script LANGUGE='JavaScript'> alert('" + testcasename + " Test Case name already exists  ')</script>");
            }
        }
        else
        {
            Response.Write("<script LANGUGE='JavaScript'> alert('please select language and test case name')</script>");
        }
    }
Esempio n. 4
0
    public Hashtable gettestagentkeyvalues(String query)
    {
        Dbmethods obj           = new Dbmethods();
        Hashtable hashKeyValues = new Hashtable();
        DataSet   ds;

        try
        {
            if (obj.getDs(query, out ds, "dsdt"))
            {
                foreach (DataRow dbRow in ds.Tables[0].Rows)
                {
                    hashKeyValues.Add(dbRow["ID"].ToString(), dbRow["machinename"].ToString());
                }
            }
        }
        catch (Exception exception)
        {
            Console.Write("Exception occurred while communicating with DB : ==> : " + exception.Message);
            Console.Write("Query : ==> : " + query);
        }

        return(hashKeyValues);
    }
Esempio n. 5
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string  testcaseid = Session["tcnameid"].ToString();
        var     Browsertype = Request.Form["BrowserType"].ToString();
        var     ActionType = Request.Form["ActionType"].ToString();
        var     Status = Request.Form["Status"].ToString();
        var     Obj_ref_id = Request.Form["obj_ReferenceName_Value1"].ToString();
        var     Value = Request.Form["targetValue"].ToString();
        var     Comments = Request.Form["comments"].ToString();
        string  StepId = Request.QueryString["RequestType"].Trim();
        Boolean ispresent = false;
        DataSet ds = null;
        string  duplicatecheck = "", qry = "";
        int     currentstepid = 0;

        Value = Value.Replace("'", "''");
        Value = Value.Replace("\r\n", string.Empty);
        Value = Value.Trim().ToString();
        if (testcaseid != "" && StepId != "")
        {
            duplicatecheck = "select * from test_case_design_steps where id={0}";

            qry = string.Format(duplicatecheck, StepId);



            if (obj.getDs(qry, out ds, "dsdt"))
            {
                if (ds.Tables[0].Rows.Count == 0)
                {
                    ispresent = true;
                }
                else
                {
                    ispresent = true;
                }
            }

            if (ispresent == true)
            {
                //Npgsql.NpgsqlConnection con = obj.getSQLConnection();
                //Npgsql.NpgsqlDataReader reader = null;
                //reader = obj.executeQueryResults(qry);
                //while (reader.Read())
                //{
                //    currentstepid = Convert.ToInt32(reader["stepid"]);
                //    currentstepid++;

                //}

                qry = string.Format(updatestep, ActionType, Obj_ref_id, Browsertype, Status, Value, Comments, StepId);
                if (obj.Update(qry, out temp))
                {
                    if (temp == 1)
                    {
                        // lblresult.Text = " " + txttestcase.Text.ToString() + " Testcase created sucessfully";
                        Response.Write("<script LANGUGE='JavaScript'> alert('Step Created sucessfully  ')</script>");
                        Session["ActiveTestcase"] = testcaseid;
                        Response.Redirect("Default2.aspx");
                    }
                    else
                    {
                        Response.Write("<script LANGUGE='JavaScript'> alert('Error in creating new step')</script>");
                    }
                }
            }
            else
            {
                //Response.Write("<script LANGUGE='JavaScript'> alert('" + actionname + " name already exists  ')</script>");
            }
        }
    }