Beispiel #1
0
 public Object RecordView(String TypeID, String RefID)
 {
     DAL.NotesList _notes = new DAL.NotesList();
        try
        {
        _notes = DAL.DALNotes.ViewNotesRecord(Convert.ToInt32(TypeID), Convert.ToInt64(RefID));
        }
        catch (Exception ex)
        {
        throw;
        }
        return _notes;
 }
Beispiel #2
0
 public static NotesList ViewNotesRecord(Int32 TypeId, Int64 RefId)
 {
     NotesList _notes = new NotesList();
     using (var context = new SycousCon())
     {
         try
         {
             _notes=(from p in context.Notes.Where(c => c.IsDeleted == 0 && c.Type == TypeId && c.RefID == RefId)
                     orderby p.CreateDate descending
                     select new NotesList()
                     {
                         NoteDesc = p.NoteDesc.Trim(),
                         CreateDate = p.CreateDate
                     }).FirstOrDefault();
         }
         catch (Exception ex)
         {
             context.Dispose();
             throw;
         }
     }
     return _notes;
 }
        public ActionResult GetConsumerDetails(String consID, String OwnerID, String PropID, String SiteID, String ClientID, String MeterID, String ConsStDt, String ConsEdDt)
        {
            if (Session["Login"] != null)
            {
                LoginSession loginsession = (LoginSession)Session["Login"];
                ViewBag.CompanyLogo = loginsession.CompanyLogo;
                String ss = BAL.Common.LayoutType(loginsession.UserType);
                ViewBag.Layout1 = ss;
                String actionName = this.ControllerContext.RouteData.Values["action"].ToString();
                String controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                ViewBag.Menu = BAL.Common.GetActiveMenu(controllerName, BAL.Common.LayoutType(loginsession.UserType));
                 DAL.NotesList Noteobj = new DAL.NotesList();
                 String ConsumerStartDate = String.Empty;
                 String ConsumerEndDate = String.Empty;
                 String DSiteID = String.Empty;
                 String DPropID = String.Empty;
                 String DOwnerID = String.Empty;
                 String DConsID = String.Empty;

                if (ClientID != null)
                {
                    String DClientID = BAL.Security.URLDecrypt(ClientID);

                    if (DSiteID != null)
                    {
                        DSiteID = BAL.Security.URLDecrypt(SiteID);
                    }
                    if (PropID != null)
                    {
                        DPropID = BAL.Security.URLDecrypt(PropID);
                    }
                    if (OwnerID != null)
                    {
                        DOwnerID = BAL.Security.URLDecrypt(OwnerID);

                    }
                    if (consID != null)
                    {
                        DConsID = BAL.Security.URLDecrypt(consID);
                    }

                    if (DConsID == "0")
                    {
                    Noteobj = BAL.NotesModel.ViewNotes("5",DOwnerID);
                    }
                    else
                    {
                    Noteobj = BAL.NotesModel.ViewNotes("6",DConsID);

                    }
                    DAL.ConsumerCommonDetails Vwobj = new DAL.ConsumerCommonDetails();
                    if ((DClientID != "0") && (DClientID != null))
                    {
                        Vwobj = BAL.SearchModel.ConsumerCommonView(DClientID, DSiteID, DPropID, DOwnerID, DConsID);
                        if(Noteobj != null)
                        {
                            Vwobj.Notes=Noteobj.NoteDesc;
                        }
                        if (Vwobj != null)
                        {
                            if ((ConsStDt != null) && (!String.IsNullOrEmpty(ConsStDt)))
                            {
                                ConsumerStartDate = BAL.Security.URLDecrypt(ConsStDt);
                                Vwobj.ConsStartDate = ConsumerStartDate;
                            }

                            if ((ConsEdDt != null) && (!String.IsNullOrEmpty(ConsEdDt)))
                            {
                                ConsumerEndDate = BAL.Security.URLDecrypt(ConsEdDt);
                                Vwobj.ConsEndDate = ConsumerEndDate;
                            }
                        }

                    }

                    return View(Vwobj);
                }
                else
                { return RedirectToAction("Index", "Search"); }
            }
            else
            { return RedirectToAction("Index", "Home"); }
        }