using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;public partial class company_view_result : System.Web.UI.Page
{
    private static string strconn = ConfigurationManager.AppSettings["dsn"];
    private SqlConnection IDConnection = new SqlConnection(strconn);
    protected void Page_Load(object sender, EventArgs e)
    {
       
        if (!Session.IsNewSession && Session.Contents["ComID"] != null)
        {
                Label2.Text = Session["ComID"].ToString();
                Label1.Text = Convert.ToString(company_view_company_resume.contt()).Trim();
        }
        else
        {
            Response.Redirect("~/company/company_index.aspx");
        }
        if (!Page.IsPostBack)
        {
            submit1.Attributes.Add("onclick", "return check();");
        }           
    }
    protected void submit1_Click(object sender, EventArgs e)
    {
        SqlCommand myCommand = new SqlCommand(null, IDConnection);
        myCommand.CommandText = "insert into CompanyContact(Data,Name,Phone) values(@Data,@Name,@Phone)";
        string data = Request.Form["data"];
        string ConnectPerson = Request.Form["name"];
        int ComPhoneNO = System.Convert.ToInt32(Request.Form["phone"]);
        myCommand.Parameters.AddWithValue("@Data", data);
        myCommand.Parameters.AddWithValue("@Name", ConnectPerson);
        myCommand.Parameters.AddWithValue("@Phone", ComPhoneNO);
        IDConnection.Open();
        myCommand.ExecuteNonQuery();
        IDConnection.Close();    }
}