public static ReadFrequencyList ViewReadFrequencyRecord(Int32 FrequencyID)
        {
            ReadFrequencyList objFrequency = new ReadFrequencyList();
               using (var context = new SycousCon())
               {
               try
               {

                   objFrequency = (from N in context.ReadFrequencies
                                join C in context.ClientMasters
                                   on N.ClientID equals C.ClientID
                                join S in context.SiteMasters
                                on N.SiteID equals S.Id
                                   where (N.IsDeleted == 0 && N.ID == FrequencyID)
                                   select new ReadFrequencyList
                                {
                                    ID = SqlFunctions.StringConvert((Double)N.ID).Trim(),
                                    FrequencyName = N.FrequencyName,
                                    Site = S.SiteName,
                                    ClientID = SqlFunctions.StringConvert((Double)C.ClientID).Trim(),
                                    Client = C.Name,
                                    SiteID = SqlFunctions.StringConvert((Double)S.Id).Trim(),

                                    FrequencyDay =
                                    (
                                         SqlFunctions.StringConvert((Double)N.FrequencyDay).Trim() == "1" ? "Sunday" :
                                         SqlFunctions.StringConvert((Double)N.FrequencyDay).Trim() == "2" ? "Monday" :
                                         SqlFunctions.StringConvert((Double)N.FrequencyDay).Trim() == "3" ? "Tuesday" :
                                         SqlFunctions.StringConvert((Double)N.FrequencyDay).Trim() == "4" ? "Wednesday" :
                                         SqlFunctions.StringConvert((Double)N.FrequencyDay).Trim() == "5" ? "Thursday" :
                                         SqlFunctions.StringConvert((Double)N.FrequencyDay).Trim() == "6" ? "Friday" :
                                         SqlFunctions.StringConvert((Double)N.FrequencyDay).Trim() == "7" ? "Saturday" : "UnKnown"
                                    ),
                                    FrequencyMode = (SqlFunctions.StringConvert((Double)N.FrequencyMode).Trim() == "1" ? "Daily" :
                                                       SqlFunctions.StringConvert((Double)N.FrequencyMode).Trim() == "2" ? "Weekly" :
                                                       SqlFunctions.StringConvert((Double)N.FrequencyMode).Trim() == "3" ? "Monthly" : ""
                                    ),
                                    DayOfMonth = N.DayOfMonth

                                }).FirstOrDefault();

                   return objFrequency;

               }
               catch (Exception ex)
               {
                   context.Dispose();
                   throw;
               }
               }
        }
 public ActionResult DView(String ID)
 {
     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 (ID != null)
         {
             String DecID = BAL.Security.URLDecrypt(ID);
             ReadFrequencyList Frequency = new ReadFrequencyList();
             if ((DecID != "0") && (DecID != null))
             {
                 Frequency = BAL.ReadFrequencyModel.ViewReadingFrequency(DecID);
             }
             return View(Frequency);
         }
         else
         { return RedirectToAction("Index", "ReadingFrequency"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }
        public Object ViewRecord(Int64 FrequenceID)
        {
            DAL.ReadFrequencyList Frequence = new ReadFrequencyList();

               try
               {
               Frequence = DAL.DALReadFrequency.ViewReadFrequencyRecord(Convert.ToInt32(FrequenceID));
               }
               catch (Exception ex)
               {
               throw;
               }
               return Frequence;
        }