Пример #1
0
        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"); }
        }
Пример #2
0
        public ActionResult _SelectSiteList()
        {
            if (Session["Login"] != null)
            {
                try
                {
                    LoginSession loginsession = (LoginSession)Session["Login"];

                    if ((loginsession.RoleName == "ADMIN") || (loginsession.RoleName == "SUPERADMIN"))
                    {
                        ViewBag.SiteList = null;
                    }
                    else
                    {
                        SiteInfo site = new SiteInfo();
                        site.UserID = Convert.ToInt64(loginsession.UserID.ToString());
                        if (site.UserID != null)
                        {
                            if (site.SiteList().Count > 0)
                            {
                                ViewBag.SiteList = new SelectList(SiteModel.SiteDropDownList(Convert.ToInt64(loginsession.UserID.ToString())), "Value", "Text");
                            }
                            else
                            {
                                ViewBag.SiteList = null;
                            }
                        }//
                    }
                }
                catch (Exception ex)
                { Console.Write(ex.Message); }
            }
            else
            {
                return RedirectToAction("Index", "Home");
            }
            return PartialView();
        }
Пример #3
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();
        }
Пример #4
0
 public ActionResult _SelectMobileSite()
 {
     if (Session["Login"] != null)
     {
         try
         {
             LoginSession loginsession = (LoginSession)Session["Login"];
             SiteInfo site = new SiteInfo();
             site.UserID = Convert.ToInt64(loginsession.UserID.ToString());
             if (site.UserID != null)
             {
                 ViewBag.MBSiteName = site.GetSiteName();
                 ViewBag.MBSiteID = site.GetSiteID();
             }
         }
         catch (Exception ex)
         { Console.Write(ex.Message); }
     }
     else
     {
         return RedirectToAction("Index", "Home");
     }
     return PartialView();
 }
Пример #5
0
        public String SiteChange(String SITEID)
        {
            if (Session["Login"] != null)
            {

                LoginSession loginsession = (LoginSession)Session["Login"];

                if (SITEID != null)
                {
                    SiteInfo site = new SiteInfo();
                    site.SiteID = Convert.ToInt64(SITEID);
                    loginsession.SiteID = SITEID;
                    loginsession.ClientID = site.GetSiteClientID().ToString();
                    Session["Login"] = loginsession;
                    return "true";
                }
                else
                {

                    return "false";
                }
            }
            else
            {
                RedirectToAction("Index", "Home");
                return "false";
            }
        }
Пример #6
0
        // Mapping Insert --------------------------------
        Boolean IRecordInsert.AddRecord(Object loggerobj)
        {
            bool flag = false;
            SiteInloggerClass logger = (SiteInloggerClass)loggerobj;
            try
            {
                SiteInLogger _logger = new SiteInLogger();
                if (logger.SiteID != null)
                {
                    _logger.SiteID = logger.SiteID;
                }
                if (logger.LoggerId != null)
                {
                    _logger.LoggerID = logger.LoggerId;
                }
                if (logger.CommunicationID != null)
                {
                    _logger.CommunicationID = logger.CommunicationID;
                }
                if (logger.AssignDate != null)
                {
                    _logger.StartDate = Common.DateGB(logger.AssignDate);
                }

                if (logger.SiteID != null)
                {
                    SiteInfo siteinfo = new SiteInfo();
                    siteinfo.SiteID = Convert.ToInt64(logger.SiteID);
                    _logger.ClientID = siteinfo.GetSiteClientID();
                }

                _logger.CreateBy = logger.CreateBy;
                _logger.CreateDate = DateTime.Now;
                _logger.EntryDate = DateTime.Now;
                if ((_logger.SiteID != null) && (_logger.LoggerID != null) && (_logger.CommunicationID != null))
                {
                    flag = DAL.DALSite.CreateSiteInLogger(_logger);
                }

            }
            catch (Exception ex)
            {
                throw;
            }
            return flag;
        }
Пример #7
0
        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;
        }