Example #1
0
 Object IRecordView4.RecordView(String SiteID, String PropertyID, String OwnerID, String ConsumerID)
 {
     DAL.CreditControlSearchList Vwdetails = new CreditControlSearchList();
     try
     {
         Vwdetails = DAL.DALSearch.CreditControlSearchRecordView(SiteID,PropertyID, OwnerID, ConsumerID);
     }
     catch (Exception ex)
     {
         throw;
     }
     return Vwdetails;
 }
Example #2
0
        public static CreditControlSearchList CreditControlSearchRecordView(String SiteID,String PropertyID, String OwnerID, String ConsumerID)
        {
            CreditControlSearchList List = new CreditControlSearchList();
            using (var context = new SycousCon())
            {
                try
                {
                    var pSiteID = 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
                    };

                    List = context.ExecuteStoreQuery<CreditControlSearchList>("exec [SYCOUS].[GetSearchCreditControlDetails] @SiteID,@PropertyID,@OwnerID,@ConsumerID",pSiteID, pPropertyID, pOwnerID, pConsumerID).FirstOrDefault();
                    return List;
                }
                catch (Exception ex)
                {
                    context.Dispose();
                    throw;
                }
            }
        }
        public ActionResult GetCreditControl(String consID, String OwnerID, String PropID, String SiteID, String ClientID, String MeterID)
        {
            if (Session["Login"] != null)
            {
                try
                {
                    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, BAL.Common.LayoutType(loginsession.UserType));
                    DAL.CreditControlSearchList Vwobj = new DAL.CreditControlSearchList();
                    if (PropID != null)
                    {
                        String DPropID = BAL.Security.URLDecrypt(PropID);
                        String _OwnerID = BAL.Security.URLDecrypt(OwnerID);
                        String _consID = BAL.Security.URLDecrypt(consID);
                        String _SiteID = BAL.Security.URLDecrypt(SiteID);
                        if ((DPropID != "0") && (DPropID != null))
                        {
                            Vwobj = BAL.SearchModel.CreditControlRecordList(_SiteID, DPropID, _OwnerID, _consID);
                            ViewBag.DirectDebit = BAL.SearchModel.DirectDebitRecordList(Vwobj.PropertyID, Vwobj.OwnerID, Vwobj.ConsumerID);
                            ViewBag.BillCreditControl = BAL.SearchModel.BillCreditControlRecordList(Vwobj.PropertyID, Vwobj.OwnerID, Vwobj.ConsumerID);

                        }
                        return View(Vwobj);
                    }
                    else
                    {
                        return RedirectToAction("Index", "Search");
                    }
                }
                catch (Exception ex)
                {
                    return Content(ex.Message.ToString());
                }
            }
            else
            { return RedirectToAction("Index", "Home"); }
        }