protected void btnSubmit_Click(object sender, EventArgs e) { try { _daNotification = new DA_Notification(); _Notification = new Notification(); _Notification.Title = txtTitle.Text; _Notification.Description = txtDescription.Text; _Notification.Type = Convert.ToInt32(ddlType.SelectedItem.Value); _Notification.Control = Convert.ToInt32(ddlcontroltype.SelectedItem.Value); _Notification.PostedBy = _member.UserCode; blResult = _daNotification.InsertNotification(_Notification); if (blResult == true) { Page.ClientScript.RegisterStartupScript(GetType(), "New Notification", "alert('Notification Inserted successfully');", true); clearRecords(); } else { Page.ClientScript.RegisterStartupScript(GetType(), "New Notification", "alert('Notifications inserted Unsuccessful');", true); } Response.Redirect("~/Account/Notifications.aspx"); } catch (Exception Ex) { ClientScript.RegisterStartupScript(GetType(), "New Notification", "alert(" + Message.ErrorMessage + ");", true); EXCEPTION_UTILITY.WriteToLog(Ex, GetLogFilePath(), _member.LoginId, "New Notification", "ETS", "btnSubmit_Click"); } }
private void NotificationsLabel() { _daNotification = new DA_Notification(); try { _lstNotification = _daNotification.getNotificationData(1); //for getting notifications var notifications = from m in _lstNotification where m.Type == 1 select m; StringBuilder _sbNotificationMarque = new StringBuilder(); foreach (var eachnotification in notifications) { _sbNotificationMarque.Append("<span style=\"color:red\">"); _sbNotificationMarque.Append("<b> NOTIFICATIONS :: </b> " + eachnotification.Description + " "); _sbNotificationMarque.Append("</span>"); } dvmarque.InnerHtml = _sbNotificationMarque.ToString(); //for getting alerts var alerts = from m in _lstNotification where m.Type == 2 select m; foreach (var eachalert in alerts) { _sbNotificationMarque.Append("<span style=\"color:green\">"); _sbNotificationMarque.Append("<b> ALERTS :: </b>" + eachalert.Description + " "); _sbNotificationMarque.Append("</span>"); } dvmarque.InnerHtml = _sbNotificationMarque.ToString(); //for getting wishes var wishes = from m in _lstNotification where m.Type == 3 select m; foreach (var eachwish in wishes) { _sbNotificationMarque.Append("<span style=\"color:blue\">"); _sbNotificationMarque.Append("<b> WISHES :: </b>" + eachwish.Description + " "); _sbNotificationMarque.Append("</span>"); } dvmarque.InnerHtml = _sbNotificationMarque.ToString(); } catch (Exception Ex) { //ClientScript.RegisterStartupScript(GetType(), "DSR", "alert(" + Message.ErrorMessage + ");", true); EXCEPTION_UTILITY.WriteToLog(Ex, Server.MapPath(Convert.ToString(ConfigurationManager.AppSettings["logpath"])), "user", "Site.Master.cs", "ETS", "NotificatinoLable"); } }
protected void LoadNotificationData() { try { _daNotification = new DA_Notification(); List <Notification> lstNotification = _daNotification.getNotificationData(_UserModel.UserCode); gvNotificationData.DataSource = lstNotification; gvNotificationData.DataBind(); } catch (Exception ex) { ClientScript.RegisterStartupScript(GetType(), "Notifications", "alert(" + Message.ErrorMessage + ");", true); EXCEPTION_UTILITY.WriteToLog(ex, GetLogFilePath(), _UserModel.LoginId, "Notifications", "ETS", "LoadNotificationData"); } }
protected void lnkSelect_Click(object sender, EventArgs e) { try { _daNotification = new DA_Notification(); LinkButton btn = (LinkButton)(sender); string b = btn.CommandArgument; int sno = Convert.ToInt32(b); _daNotification.updateNotificationData(sno); LoadNotificationData(); Page.ClientScript.RegisterStartupScript(GetType(), "InActive ", "alert('Inactived Succesfully');", true); } catch (Exception ex) { ClientScript.RegisterStartupScript(GetType(), "Notifications", "alert(" + Message.ErrorMessage + ");", true); EXCEPTION_UTILITY.WriteToLog(ex, GetLogFilePath(), _UserModel.LoginId, "Notifications", "ETS", "LoadNotificationData"); } }