public ActionResult AddRecord(String SiteID, String ClientID)
        {
            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));
                IEnumerable<DAL.PropertyList>PropertyList = null;
                try
                {
                    if ((SiteID != null) && (ClientID != null))
                    {
                        String DSiteID = BAL.Security.URLDecrypt(SiteID);
                        String DClientID = BAL.Security.URLDecrypt(ClientID);

                        if ((DSiteID != "0") && (DSiteID != null) && (DClientID != "0") && (DClientID != null))
                        {
                            SiteInfo siteobj = new SiteInfo();
                            siteobj.SiteID = Convert.ToInt64(DSiteID);
                            ViewBag.SiteName = siteobj.DefaultSiteName();
                            ViewBag.ClientName = siteobj.GetSiteInClientName();
                            ViewBag._ClientID = DClientID;
                            ViewBag._SiteID = DSiteID;
                            PropertyList = BAL.PropertyModel.UnOccupyPropertyList().Where(c => (c.ClientID == DClientID && c.SiteID == DSiteID));

                            return View(PropertyList);
                        }
                        else
                        { return RedirectToAction("Index", "Site"); }
                    }
                    else
                    { return RedirectToAction("Index", "Site"); }
                }

                catch (Exception ex)
                {
                    return Content("Error:" + ex.Message);
                }

              }
              else
              { return RedirectToAction("Index", "Home"); }
        }
Beispiel #2
0
        public ActionResult _SelectSite()
        {
            if (Session["Login"] != null)
            {
                try
                {
                    LoginSession loginsession = (LoginSession)Session["Login"];
                    SiteInfo site = new SiteInfo();

                    if (loginsession.SiteID.ToString() == "0")
                    {
                        ViewBag.SiteName = "ALL";
                        ViewBag.SiteID = loginsession.SiteID.ToString();
                    }
                    else
                    {
                        if (loginsession.SiteID.ToString() != null)
                        {
                            site.SiteID = Convert.ToInt64(loginsession.SiteID.ToString());
                            ViewBag.SiteName = site.DefaultSiteName();
                            ViewBag.SiteID = loginsession.SiteID.ToString();
                        }
                        //if (loginsession.SiteID.ToString() == null)
                        //{
                        //    loginsession.SiteID="-1";
                        //    loginsession.ClientID = "-1";
                        //}
                    }
                }
                catch (Exception ex)
                { Console.Write(ex.Message); }
            }
            else
            {
                return RedirectToAction("Index", "Home");
            }
            return PartialView();
        }
        public Object EditRecord(Int64 CreditId)
        {
            SiteCreditControlClass _credit = new SiteCreditControlClass();
            try
            {
                SiteCreditControl credit = DAL.DALCreditControl.EditSiteCreditControl(Convert.ToInt64(CreditId));
                _credit.ID = Convert.ToInt64(credit.ID);

                if (credit.SiteID!= null)
                {
                    _credit.SiteID = credit.SiteID;
                }
                if (credit.Residential != null)
                {
                    _credit.Residential = credit.Residential;
                }

                if (credit.Commercial != null)
                {
                    _credit.Commercial = credit.Commercial;
                }

                if (credit.Residential2 != null)
                {
                    _credit.Residential2 = credit.Residential2;
                }

                if (credit.Commercial2 != null)
                {
                    _credit.Commercial2 = credit.Commercial2;
                }

                SiteInfo site = new SiteInfo();
                site.SiteID = credit.SiteID;
                _credit.Site = site.DefaultSiteName();
                _credit.Client = site.GetSiteClientName();

            }
            catch (Exception ex)
            {
                throw;
            }
            return _credit;
        }