示例#1
0
 public Object RecordView(String ClintID, String SiteID, String PropertyID, String OwnerID, String ConsumerID, String ConsumerStartDate, String ConsumerEnddate)
 {
     DAL.ConsumerCommonDetails Vwdetails = new ConsumerCommonDetails();
        try
        {
        Vwdetails = DAL.DALSearch.ConsumerCommonDetailsView(ClintID, SiteID, PropertyID, OwnerID, ConsumerID, ConsumerStartDate, ConsumerEnddate);
        }
        catch (Exception ex)
        {
        throw;
        }
        return Vwdetails;
 }
示例#2
0
        public static ConsumerCommonDetails ConsumerCommonDetailsView(String ClintID, String SiteID, String PropertyID, String OwnerID, String ConsumerID,String ConsumerStartdate , String ConsumerEndDate)
        {
            ConsumerCommonDetails List = new ConsumerCommonDetails();
            using (var context = new SycousCon())
            {
                try
                {

                    var pClient = new SqlParameter
                    {
                        ParameterName = "ClientID",
                        Value = ClintID,
                        Direction = ParameterDirection.Input
                    };
                    var pSite = new SqlParameter
                    {
                        ParameterName = "SiteID",
                        Value = SiteID,
                        Direction = ParameterDirection.Input
                    };

                    var pPropertyID = new SqlParameter
                    {
                        ParameterName = "PropertyID ",
                        Value = PropertyID,
                        Direction = ParameterDirection.Input
                    };

                    var pOwnerID = new SqlParameter
                    {
                        ParameterName = "OwnerID",
                        Value = OwnerID,
                        Direction = ParameterDirection.Input
                    };
                    var pConsumerID = new SqlParameter
                    {
                        ParameterName = "ConsumerID",
                        Value = ConsumerID,
                        Direction = ParameterDirection.Input
                    };

                    var pConsumerStartDate = new SqlParameter
                    {
                        ParameterName = "ConsumerStartDate",
                        Value = ConsumerStartdate != null ? DAL.Commmon.SqlFormatDate(ConsumerStartdate) : "",
                        Direction = ParameterDirection.Input
                    };

                    var pconsumerEndDate = new SqlParameter
                    {
                        ParameterName = "consumerEndDate",
                        Value = ConsumerEndDate != "0" ? DAL.Commmon.SqlFormatDate(ConsumerEndDate) : "",
                        Direction = ParameterDirection.Input
                    };

                    List = context.ExecuteStoreQuery<ConsumerCommonDetails>("exec [SYCOUS].[GetConsumerCommonDetails] @ClientID,@SiteID,@PropertyID,@OwnerID,@ConsumerID,@ConsumerStartDate,@consumerEndDate", pClient, pSite, pPropertyID, pOwnerID, pConsumerID, pConsumerStartDate, pconsumerEndDate).FirstOrDefault();

                    return List;
                }
                catch (Exception ex)
                {
                    context.Dispose();
                    throw;
                }
            }
        }
        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"); }
        }