Permalink
Browse files

Merge branch 'master' of https://github.com/bduong/toms-list

  • Loading branch information...
2 parents 2b02d7e + e85f70c commit 6ffe5de1a4a4840ce514734378e45266a9796c03 @Martikos Martikos committed Apr 24, 2013
@@ -47,17 +47,15 @@ public static List<Notification> getNotifications(String userId)
string Message = (string)reader[ColumnNames.Message];
int NotificationId = (int)reader[ColumnNames.NotificationId];
DateTime Date = (DateTime)reader[ColumnNames.Date];
- int ParentId = (int)reader[ColumnNames.ParentId];
- returnList.Add(new Notification(Message, SenderId, ReceiverId, Date, ParentId));
+ returnList.Add(new Notification(Message, SenderId, ReceiverId, Date));
ids.Add(ReceiverId);
}
} else if(ReceiverId.ToString().Equals(userId)) {
if(!ids.Contains(SenderId)) {
string Message = (string)reader[ColumnNames.Message];
int NotificationId = (int)reader[ColumnNames.NotificationId];
DateTime Date = (DateTime)reader[ColumnNames.Date];
- int ParentId = (int)reader[ColumnNames.ParentId];
- returnList.Add(new Notification(Message, SenderId, ReceiverId, Date, ParentId));
+ returnList.Add(new Notification(Message, SenderId, ReceiverId, Date));
ids.Add(SenderId);
}
}
@@ -87,9 +85,8 @@ public static List<Notification> getConversation(String SenderId, String Receive
{
int NotificationId = (int)reader[ColumnNames.NotificationId];
string Message = (string)reader[ColumnNames.Message];
- DateTime date = (DateTime)reader[ColumnNames.Date];
- int ParentId = (int)reader[ColumnNames.ParentId];
- returnList.Add(new Notification(Message, senderId, receiverId, date, ParentId));
+ DateTime date = (DateTime)reader[ColumnNames.Date];
+ returnList.Add(new Notification(Message, senderId, receiverId, date));
}
conn.Close();
@@ -100,12 +97,12 @@ public static void saveNotification(Notification notification)
{
SqlConnection conn = DBConnector.getSqlConnection();
conn.Open();
- SqlCommand cmd = new SqlCommand("INSERT INTO Notifications (Message, SenderId, ReceiverId, Date, ParentId) VALUES (@Message, @SenderId, @ReceiverId, @Date, @ParentId); SELECT CONVERT(int, SCOPE_IDENTITY())", conn);
+ SqlCommand cmd = new SqlCommand("INSERT INTO Notifications (Message, SenderId, ReceiverId, Date) VALUES (@Message, @SenderId, @ReceiverId, @Date); SELECT CONVERT(int, SCOPE_IDENTITY())", conn);
cmd.Parameters.AddWithValue("@Message", notification.message);
cmd.Parameters.AddWithValue("@SenderId", notification.senderId);
cmd.Parameters.AddWithValue("@ReceiverId", notification.recieverId);
cmd.Parameters.AddWithValue("@Date", notification.sentDate);
- cmd.Parameters.AddWithValue("@ParentId", notification.parentId);
+
int uid = Convert.ToInt32(cmd.ExecuteScalar());
conn.Close();
}
@@ -117,6 +114,5 @@ private static class ColumnNames
public static string SenderId = "SenderId";
public static string ReceiverId = "ReceiverId";
public static string Date = "Date";
- public static string ParentId = "ParentId";
}
}
@@ -13,18 +13,17 @@ public class Notification
public Guid senderId { get; set; }
public Guid recieverId { get; set; }
public DateTime sentDate { get; set; }
- public int parentId { get; set; }
- public Notification(string message, Guid senderId, Guid recieverId, DateTime date, int parentId)
+ public Notification(string message, Guid senderId, Guid recieverId, DateTime date)
{
this.message = message;
this.senderId = senderId;
this.recieverId = recieverId;
this.sentDate = date;
- this.parentId = parentId;
+
}
public static Notification createNewNotification(Guid sender, Guid reciever) {
- return new Notification("", sender, reciever, DateTime.Now, 0);
+ return new Notification("", sender, reciever, DateTime.Now);
}
}
View
@@ -3,6 +3,5 @@
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
- <asp:Label ID="Information" runat="server"></asp:Label>
- <a href="Profile.aspx"
+ <asp:Label ID="Information" runat="server"></asp:Label>
</asp:Content>
@@ -30,8 +30,9 @@ protected void Page_Load(object sender, EventArgs e)
begin_time_list.Items.Add(i + ":" + (j * 15).ToString().PadLeft(2, '0') + " PM");
end_time_list.Items.Add(i + ":" + (j * 15).ToString().PadLeft(2, '0') + " PM");
}
- }
- date_cal.SelectedDate = DateTime.Now;
+ }
+ date_cal.SelectedDate = DateTime.Today;
+ date_cal.VisibleDate = DateTime.Today;
begin_time_list.SelectedIndex = 0;
end_time_list.SelectedIndex = 0;
View
@@ -66,7 +66,7 @@ protected void contact_seller(object sender, EventArgs e)
MembershipUser user = Membership.GetUser();
Guid senderId = (Guid)user.ProviderUserKey;
- Notification notification = new Notification(message, senderId, receiverId, DateTime.Now, 0);
+ Notification notification = new Notification(message, senderId, receiverId, DateTime.Now);
NotificationDataService.saveNotification(notification);
contact_log.Style.Add("color", "#00ff00");
View
@@ -44,11 +44,11 @@
<httpErrors errorMode="Custom" existingResponse="Replace" >
<remove statusCode="404" subStatusCode="-1" />
- <error statusCode="404" path="~/Views/Error.aspx?e_code=404" responseMode="Redirect"/>
+ <error statusCode="404" path="/Views/Error.aspx?e_code=404" responseMode="Redirect"/>
<remove statusCode="403" subStatusCode="-1" />
- <error statusCode="403" path="~/Views/Error.aspx?e_code=403" responseMode="Redirect"/>
+ <error statusCode="403" path="/Views/Error.aspx?e_code=403" responseMode="Redirect"/>
<remove statusCode="500" subStatusCode="-1" />
- <error statusCode="500" path="~/Views/Error.aspx?e_code=500" responseMode="Redirect" />
+ <error statusCode="500" path="/Views/Error.aspx?e_code=500" responseMode="Redirect" />
</httpErrors>
</system.webServer>

0 comments on commit 6ffe5de

Please sign in to comment.