public async Task <HttpStatusCode> EditPublicChatMessage(PublicChat publicChat) { PublicChatsController publicChatsController = new PublicChatsController(); var status = await publicChatsController.UpdatePublicChatAsync(publicChat); return(status); }
private void LoadInitMessage() { PublicChat pObj = new PublicChat(); pObj.Chat_r_id = long.Parse(HiddenCid.Value); DataTable dTable = new DataTable(); dTable = pObj.GetInitChat(); if (dTable != null) { object val = null; val = dTable.Rows[0]["msg_id"]; if (val != null) { HiddenMsgid.Value = val.ToString(); } else { HiddenMsgid.Value = "0"; } } else { HiddenMsgid.Value = "0"; } repeatChat.DataSource = dTable; repeatChat.DataBind(); }
public async Task <IHttpActionResult> PutPublicChat(int id, PublicChat publicChat) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != publicChat.Id) { return(BadRequest()); } db.Entry(publicChat).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PublicChatExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <HttpStatusCode> UpdatePublicChatAsync(PublicChat publicChat) { HttpResponseMessage response = await PublicResources.client.PutAsJsonAsync( $"api/PublicChatsAPI/{publicChat.Id}", publicChat); response.EnsureSuccessStatusCode(); return(response.StatusCode); }
private void LoadChatData() { PublicChat pObj = new PublicChat(); pObj.Chat_r_id = long.Parse(HiddenCid.Value); pObj.Msg_id = long.Parse(HiddenMsgid.Value); repeatChat.DataSource = pObj.GetChats(); repeatChat.DataBind(); }
public async Task <IHttpActionResult> GetPublicChat(int id) { PublicChat publicChat = await db.PublicChats.FindAsync(id); if (publicChat == null) { return(NotFound()); } return(Ok(publicChat)); }
public override IPublicChat GetPublicChat() { if (publicChat == null) { publicChat = new PublicChat(); publicChat.Init(); publicChat.Dispose(); } return(publicChat); }
public async Task <IHttpActionResult> PostPublicChat(PublicChat publicChat) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PublicChats.Add(publicChat); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = publicChat.Id }, publicChat)); }
private void JoinChatRoom() { try { PublicChat pObj = new PublicChat(); pObj.Chat_r_id = long.Parse(HiddenCid.Value); pObj.User_id = uInfo.UserId; pObj.JoinChatRoom(); } catch (Exception ex) { } }
private void LoadMessages() { try { PublicChat pObj = new PublicChat(); pObj.User_id = long.Parse(HiddenUId.Value); gvUserMessage.DataSource = pObj.GetUserChats(); gvUserMessage.DataBind(); } catch (Exception ex) { } }
public async Task <IHttpActionResult> DeletePublicChat(int id) { PublicChat publicChat = await db.PublicChats.FindAsync(id); if (publicChat == null) { return(NotFound()); } db.PublicChats.Remove(publicChat); await db.SaveChangesAsync(); return(Ok(publicChat)); }
protected void Page_Load(object sender, EventArgs e) { try { uInfo = (userInfo)Session["_di09USR"]; PublicChat pObj = new PublicChat(); pObj.User_id = uInfo.UserId; pObj.LeaveChatRoom(); } finally { Response.Redirect("~/home.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { topPanel.Visible = !setUsername(); LoadChatRooms(); if (!Page.IsPostBack) { if (isLoggedIn()) { //EXIT USER FROM ANY PRE CHATROOMS PublicChat pObj = new PublicChat(); pObj.User_id = uInfo.UserId; pObj.LeaveChatRoom(); } } }
protected void Page_Load(object sender, EventArgs e) { setUsername(); LoadChatRooms(); if (!Page.IsPostBack) { if (uInfo != null) { //EXIT USER FROM ANY PRE CHATROOMS PublicChat pObj = new PublicChat(); pObj.User_id = uInfo.UserId; pObj.LeaveChatRoom(); } } }
protected void Page_Load(object sender, EventArgs e) { setUsername(); if (!Page.IsPostBack) { //EXIT USER FROM ANY PRE CHATROOMS PublicChat pObj = new PublicChat(); pObj.User_id = uInfo.UserId; pObj.LeaveChatRoom(); //LOAD ALL DETAILS Session[USER_SAVE_STRING] = USER_INIT_PATH; LoadUserDetails(); imgUser.ImageUrl = Session[USER_SAVE_STRING].ToString(); } }
protected override void OnPreInit(EventArgs e) { if (Context.Session != null) { if (Session["_di09USR"] != null) { userInfo uInfo = (userInfo)Session["_di09USR"]; //EXIT USER FROM ANY PRE CHATROOMS PublicChat pObj = new PublicChat(); pObj.User_id = uInfo.UserId; pObj.LeaveChatRoom(); LoginCls logoutObj = new LoginCls(); logoutObj.LogOut(uInfo.UserId); } } Session.Abandon(); Response.Redirect("~/home.aspx", true); }
if (Context.Session != null) { if (Session["_di09USR"] != null) { userInfo uInfo = (userInfo)Session["_di09USR"]; //EXIT USER FROM ANY PRE CHATROOMS PublicChat pObj = new PublicChat(); pObj.User_id = uInfo.UserId; pObj.LeaveChatRoom(); LoginCls logoutObj = new LoginCls(); logoutObj.LogOut(uInfo.UserId); } } Session.Abandon(); Response.Redirect("~/home.aspx", true); } }