Exemplo n.º 1
0
        public Object ViewRecord(Int64 NotifyId)
        {
            DAL.NotificationList Vwnotification = new NotificationList();

            try
            {
            Vwnotification = DAL.DALNotification.ViewNotificationRecord(Convert.ToInt32(NotifyId));
            }
            catch (Exception ex)
            {
            throw;
            }
            return Vwnotification;
        }
Exemplo n.º 2
0
 public ActionResult NView(String Notify_ID, String Type)
 {
     if (Session["Login"] != null)
     {
         LoginSession loginsession = (LoginSession)Session["Login"];
         ViewBag.CompanyLogo = loginsession.CompanyLogo;
         ViewBag.Layout1 = BAL.Common.LayoutType(loginsession.UserType);
         String actionName = this.ControllerContext.RouteData.Values["action"].ToString();
         String controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
         ViewBag.Menu = BAL.Common.GetActiveMenu(controllerName, actionName, BAL.Common.LayoutType(loginsession.UserType));
         ViewBag.RoleName = loginsession.RoleName;
         if (Notify_ID != null)
         {
             String Dec_NotifyID = BAL.Security.URLDecrypt(Notify_ID);
             String DecType = BAL.Security.URLDecrypt(Type);
             ViewBag.SType = DecType;
             NotificationList notify = new NotificationList();
             if ((Dec_NotifyID != "0") && (Dec_NotifyID != null))
             {
                 notify = BAL.NotificationModel.ViewNotification(Dec_NotifyID);
             }
             return View(notify);
         }
         else
         { return RedirectToAction("Index", "Notify"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }
Exemplo n.º 3
0
        public static NotificationList ViewNotificationRecord(Int32 NotifyID)
        {
            NotificationList objNotify = new NotificationList();
            using (var context = new SycousCon())
            {
            try
            {

                objNotify = (from N in context.NotificationMasters
                           join C in context.ClientMasters
                              on N.ClientID equals C.ClientID
                           join S in context.SiteMasters
                           on N.SiteID equals S.Id
                             where (N.DeleteStatus == 0 && N.NotificationID == NotifyID)
                             select new NotificationList
                           {
                               NotificationID = SqlFunctions.StringConvert((Double)N.NotificationID).Trim(),
                               NotificationName = N.NotificationName,
                               TypeID =SqlFunctions.StringConvert((Double)N.Type).Trim(),
                               NoOfDays = SqlFunctions.StringConvert((Double)N.NoOfDays).Trim(),
                               Type=
                               (
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "1" ? "Client Notification" :
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "2"  ? "Frequency of Retrieval" :
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "3"  ? "Site Billing Frequency" : "Unknown"
                                ),
                               Site = S.SiteName,
                               ClientID = SqlFunctions.StringConvert((Double)C.ClientID).Trim(),
                               Client = C.Name,
                               SiteID = SqlFunctions.StringConvert((Double)S.Id).Trim(),
                               NotificationDate  = N.NotificationDate,
                               NotificationDay =
                               (
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "1" ? "Sunday" :
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "2" ? "Monday" :
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "3" ? "Tuesday" :
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "4" ? "Wednesday" :
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "5" ? "Thursday" :
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "6" ? "Friday" :
                                    SqlFunctions.StringConvert((Double)N.Type).Trim() == "7" ? "Saturday" : "UnKnown"
                               ),
                               NotificationMode = (SqlFunctions.StringConvert((Double)N.NotificationMode).Trim() == "1" ? "Daily" :
                                                  SqlFunctions.StringConvert((Double)N.NotificationMode).Trim() == "2" ? "Weekly" :
                                                  SqlFunctions.StringConvert((Double)N.NotificationMode).Trim() == "3" ? "Monthly" : ""
                               ),
                               DayOfMonth =N.DayOfMonth

                           }).FirstOrDefault();

                return objNotify;

            }
            catch (Exception ex)
            {
                context.Dispose();
                throw;
            }
            }
        }