protected void Button1_Click(object sender, EventArgs e)
{
string sql = "";
var com = new SqlCommand();
sql +=
"INSERT INTO Xtrain.XTV7_3_Video_View (XTV7_VVR_Time_Start, XTV7_VVR_Time_Close, XTV7_UserName, XTV7_Videos_ID) Values (@XTV7_VVR_Time_Start, @XTV7_VVR_Time_Close, @XTV7_UserName, @XTV7_Videos_ID)";
//Geek.XTV7_VidReg;
com.Parameters.Add("@XTV7_VVR_Time_Start", SqlDbType.DateTime).Value = DateTime.Parse(lblVidReg.Text);
com.Parameters.Add("@XTV7_VVR_Time_Close", SqlDbType.DateTime).Value = DateTime.Parse(DateTime.Now.ToString());
com.Parameters.Add("@XTV7_UserName", SqlDbType.NVarChar).Value = HttpContext.Current.User.Identity.Name.ToString();
com.Parameters.Add("@XTV7_Videos_ID", SqlDbType.Int).Value = Int32.Parse(Geek.XTV7_Videos_ID.ToString());
try
{
data.ExecuteNonQuery(sql, com);
}
catch (Exception ex)
{
string script = "<script language=\"JavaScript\">alert('Error : " + ex.Message + "');</script>";
Page.RegisterStartupScript("error", script);
}
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind();", true);
string scriptreturn = "<script type='text/javascript'>closeRadWindow('VideoViewer.aspx');</script>";
ClientScript.RegisterStartupScript(GetType(), "Redirect", scriptreturn, false);
}
|