Ejemplo n.º 1
0
        public ActionResult ViewDashboard_Mobile(int PropId)
        {
            Session["PropId"]   = PropId;
            Session["CurrCode"] = BL_Currency.GetCurrencyByPropId(PropId);
            //Session["Symbol"] = BL_Currency.GetSymbolByPropId(PropId);
            Session["Flag"]    = BL_Currency.GetFlagByPropId(PropId);
            TempData["PropID"] = PropId;

            return(View("../Dashboard/Dashboard"));
        }
Ejemplo n.º 2
0
 public ActionResult AuthPendingNego(int PropId, string PropName)
 {
     Session["MenuType"] = "2";
     Session["PropId"]   = PropId;
     Session["CurrCode"] = BL_Currency.GetCurrencyByPropId(PropId);
     //Session["Symbol"] = BL_Currency.GetSymbolByPropId(PropId);
     Session["Flag"]     = BL_Currency.GetFlagByPropId(PropId);
     Session["PropName"] = PropName;
     //return RedirectToAction("ViewDashboard1", new { PropId = PropId });
     return(RedirectToAction("Index", "PendingNegotiations"));
 }
Ejemplo n.º 3
0
        public ActionResult ViewDashboard(int PropId, string PropName)
        {
            Session["MenuType"] = "2";
            Session["PropId"]   = PropId;
            Session["CurrCode"] = BL_Currency.GetCurrencyByPropId(PropId);
            //Session["Symbol"] = BL_Currency.GetSymbolByPropId(PropId);
            Session["Flag"]     = BL_Currency.GetFlagByPropId(PropId);
            Session["PropName"] = PropName;

            //eDashboardModel dashboardModel = new eDashboardModel();
            //dashboardModel.iPropId = PropId;


            //return View("../Dashboard/Dashboard", dashboardModel);

            // return RedirectToAction("ViewDashboard1", new { PropId = PropId });
            return(RedirectToAction("ViewDashboard1"));
        }
Ejemplo n.º 4
0
        public ActionResult Login(OneFineRateBLL.Entities.eLogin model, string returnUrl)
        {
            TempData["Error"] = null;
            if (ModelState.IsValid)
            {
                OneFineRateBLL.BL_Login.UserDetails eobj           = new OneFineRateBLL.BL_Login.UserDetails();
                OneFineRateBLL.BL_Login.UserDetails eobjActiveUser = new OneFineRateBLL.BL_Login.UserDetails();
                OneFineRateAppUtil.clsUtils.ConvertToObject(OneFineRateBLL.BL_Login.ValidateUser(model.UserName, model.Password), eobj);
                OneFineRateAppUtil.clsUtils.ConvertToObject(OneFineRateBLL.BL_Login.ActiveUser(model.UserName), eobjActiveUser);
                if (eobj.iUserId > 0 && eobjActiveUser.cStatus == "A")
                {
                    if (model.RememberMe)
                    {
                        Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(30);
                        Response.Cookies["Password"].Expires = DateTime.Now.AddDays(30);
                    }
                    else
                    {
                        Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1);
                        Response.Cookies["Password"].Expires = DateTime.Now.AddDays(-1);
                    }
                    Response.Cookies["UserName"].Value = model.UserName.Trim();
                    Response.Cookies["Password"].Value = model.Password.Trim();


                    Session["UserDetails"] = eobj;
                    Session["MenuType"]    = "1";
                    //Session["Username"] = eobj.UserName;
                    //Session["FisrtName"] = eobj.FisrtName;
                    //Session["LastName"] = eobj.LastName;

                    string sPath = OneFineRateBLL.BL_Menu.GetHomePageByUserId(eobj.iUserId);
                    if (sPath != null)
                    {
                        FormsAuthentication.SetAuthCookie(model.UserName, true);

                        #region Redirect For Booking Confirmation

                        if (model.sBookingId != null)
                        {
                            var bookingIdDecoded = OneFineRateAppUtil.clsUtils.Decode(model.sBookingId);

                            var iPropId = BL_Booking.GetPropIdByBookingId(bookingIdDecoded);

                            if (iPropId.HasValue)
                            {
                                Session["MenuType"] = "2";
                                Session["PropId"]   = iPropId;

                                Session["CurrCode"] = BL_Currency.GetCurrencyByPropId(iPropId.Value);
                                //Session["Symbol"] = BL_Currency.GetSymbolByPropId(PropId);
                                Session["Flag"]     = BL_Currency.GetFlagByPropId(iPropId.Value);
                                Session["PropName"] = BL_PropDetails.GetPropertyName(iPropId.Value);

                                return(RedirectToRoute("BookingConfirmation", new { bookingId = model.sBookingId }));
                            }
                        }

                        #endregion Redirect For Pending Confirmation

                        #region Redirect For Pending Negotiation

                        if (model.sPropId != null)
                        {
                            int iPropId = 0;
                            try
                            {
                                iPropId = int.Parse(clsUtils.Decode(model.sPropId));
                            }
                            catch (Exception)
                            {
                            }

                            if (iPropId > 0)
                            {
                                Session["MenuType"] = "2";
                                Session["PropId"]   = iPropId;

                                Session["CurrCode"] = BL_Currency.GetCurrencyByPropId(iPropId);
                                //Session["Symbol"] = BL_Currency.GetSymbolByPropId(PropId);
                                Session["Flag"]     = BL_Currency.GetFlagByPropId(iPropId);
                                Session["PropName"] = BL_PropDetails.GetPropertyName(iPropId);

                                return(RedirectToAction("Index", "PendingNegotiations"));
                            }
                        }

                        #endregion

                        string[] Values = sPath.Split('/');
                        if (Values.Length == 2)
                        {
                            //FormsAuthentication.RedirectFromLoginPage(model.UserName, model.RememberMe);
                            return(RedirectToAction("Index", Values[1]));
                        }
                        else
                        {
                            //FormsAuthentication.RedirectFromLoginPage(model.UserName, model.RememberMe);
                            return(RedirectToAction(Values[2], Values[1]));
                        }
                    }
                    else
                    {
                        TempData["Error"] = "All the Groups are Inactive for this user.";
                    }
                }

                if (eobj.iUserId == 0)
                {
                    // ModelState.AddModelError("", "Incorrect username and/or password");
                    TempData["Error"] = "Incorrect username and/or password";
                }
                else if (eobjActiveUser.cStatus == "I")
                {
                    TempData["Error"] = "User has been diasbled by Administrator.";
                }
            }

            return(View(model));
        }