-
Notifications
You must be signed in to change notification settings - Fork 0
/
Helpchild.aspx.cs
131 lines (111 loc) · 5.61 KB
/
Helpchild.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
130
131
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Zero.ShareDream;
namespace Zero.ShareDream
{
public partial class Helpchild : System.Web.UI.Page
{
private database d;
private long uid;
protected void Page_Load(object sender, EventArgs e)
{
d = new database();
uid = Convert.ToInt64(Request.QueryString["uid"]);
if (!string.IsNullOrEmpty(Request.QueryString["uid"]))
{
Child child = d.GetChildByID(uid);
if (child != null)
{
Page.Title = child.ChildName;
HtmlMeta meta = new HtmlMeta();
meta.Name = "Description";
meta.Content = child.ChildName + " " + child.ChildCountry + " " + child.ChildStory;
MetaPlaceHolder.Controls.Add(meta);
HtmlMeta metaImage1 = new HtmlMeta();
metaImage1.Attributes.Add("property", "og:image:type");
metaImage1.Content = "image/png";
MetaPlaceHolder2.Controls.Add(metaImage1);
HtmlMeta metaImage3 = new HtmlMeta();
metaImage3.Attributes.Add("property", "og:image:height");
metaImage3.Content = "148";
MetaPlaceHolder3.Controls.Add(metaImage3);
HtmlMeta metaImage4 = new HtmlMeta();
metaImage4.Attributes.Add("property", "og:image:width");
metaImage4.Content = "148";
MetaPlaceHolder4.Controls.Add(metaImage4);
HtmlMeta metaImage5 = new HtmlMeta();
metaImage5.Attributes.Add("property", "og:url");
metaImage5.Content = HttpContext.Current.Request.Url.AbsoluteUri;
MetaPlaceHolder5.Controls.Add(metaImage5);
HtmlMeta metatitle = new HtmlMeta();
metaImage5.Attributes.Add("property", "og:title");
metaImage5.Content = child.ChildName + ", Age:" + child.ChildAge + ", City:" + child.ChildCity + ", Country:" + child.ChildCountry ;
Metatitle.Controls.Add(metaImage5);
meta.Content = child.ChildName + " " + child.ChildCountry + " " + child.ChildStory;
string saveToFolder = "http://localhost:11834/Photos//" + child.FileName;
HtmlMeta metaImage2 = new HtmlMeta();
metaImage2.Attributes.Add("property", "og:image");
metaImage2.Content = saveToFolder;
MetaPlaceHolder2.Controls.Add(metaImage2);
LBFacebook.Text = "<a name=\"fb_share\" share_url='http://www.sharedream.in/Help.aspx?uid=" + uid +"' ></a>";
LBTwitter.Text = " <a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-url=\"http://www.sharedream.in/Help.aspx?uid=" + uid + "\" data-via=\"ceo_zerobuddy\">Tweet</a>";
LID.Text = "";
LChildName.Text = child.ChildName.ToString();
LChildAge.Text = child.ChildAge.ToString();
Label1.Text = child.ChildStory;
IChildPic1.ImageUrl = "~/profilePic.aspx?cid=" + uid;
RepHelp.DataSource = d.GetAllhelpByChildID(uid);
RepHelp.DataBind();
if (RepHelp.Items.Count > 0)
{
LKind.Text = "<h1>Kind of Help (" + RepHelp.Items.Count + ")</h1>";
}
}
}
}
protected void repAlert_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
}
}
protected void BSubmit_Click(object sender, EventArgs e)
{
if (!String.IsNullOrEmpty(TBName.Text) &&
!String.IsNullOrEmpty(TBEmail.Text) &&
!String.IsNullOrEmpty(TBHelp.Text) &&
!String.IsNullOrEmpty(TBMobileNo.Text)
)
{
Help help = new Help();
help.HelperName = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(TBName.Text);
help.HelperEmail = TBEmail.Text;
help.HelperMobileNo = Convert.ToInt64(TBMobileNo.Text);
help.HelperHelp = TBHelp.Text;
help.CreateDate = DateTime.Now;
help.HelpChildID = uid;
d.SaveHelp(help);
TBEmail.Text = "";
TBName.Text = "";
TBEmail.Text = "";
TBMobileNo.Text = "";
TBHelp.Text = "";
RepHelp.DataSource = d.GetAllhelpByChildID(uid);
RepHelp.DataBind();
if (RepHelp.Items.Count > 0)
{
LKind.Text = "<h1>Kind of Help (" + RepHelp.Items.Count + ")</h1>";
}
}
}
/*
if (child != null)
{
}*/
}
}