-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUpdateMemberVideo.aspx.cs
129 lines (89 loc) · 4.11 KB
/
UpdateMemberVideo.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Registration : System.Web.UI.Page
{
string a ;
string panno = "", str = "", vatno = "", str1 = "", str2 = "", logo = "", str3 = "", logo1 = "";
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["db"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("select * from MemberInfo where MemberId =@username", con);
cmd.Parameters.AddWithValue("@username", Session["Mid"]);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
txtName.Text = dt.Rows[0]["Name"].ToString();
txtEmail.Text = Session["Mid"].ToString();
}
}
protected void btnClear_Click(object sender, EventArgs e)
{
txtName.Text = "";
txtEmail.Text = "";
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["db"].ToString());
con.Open();
SqlCommand cmd;
string a = "update ProfileInfo set VideoLink=@p1 where MemberId=@p11";
cmd = new SqlCommand(a, con);
cmd.Parameters.AddWithValue("@p11", Session["Mid"]);
cmd.Parameters.AddWithValue("@p1", txtV.Text);
cmd.ExecuteNonQuery();
con.Close();
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Detail Updated Successfull');window.location.replace('MemberHome.aspx');</script>");
}
protected void btnImage_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
str2 = FileUpload1.FileName;
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/CoverImage/" + str2));
logo = "~/CoverImage/" + str2.ToString();
}
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["db"].ToString());
con.Open();
SqlCommand cmd;
string a = "update ProfileInfo set CoverImage=@p1 where MemberId=@p11";
cmd = new SqlCommand(a, con);
cmd.Parameters.AddWithValue("@p11", Session["Mid"]);
cmd.Parameters.AddWithValue("@p1", logo);
cmd.ExecuteNonQuery();
con.Close();
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Detail Updated Successfull');window.location.replace('MemberHome.aspx');</script>");
}
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
str2 = FileUpload1.FileName;
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/CoverImage/" + str2));
logo = "~/CoverImage/" + str2.ToString();
}
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["db"].ToString());
con.Open();
SqlCommand cmd;
string a = "update MemberInfo set Image=@p1 where MemberId=@p11";
cmd = new SqlCommand(a, con);
cmd.Parameters.AddWithValue("@p11", Session["Mid"]);
cmd.Parameters.AddWithValue("@p1", logo);
cmd.ExecuteNonQuery();
con.Close();
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Detail Updated Successfull');window.location.replace('MemberHome.aspx');</script>");
}
}