public ActionResult UpdateAgentChangePassword(BlAgent ObjBlAgent)
        {
            ObjBlAgent.UserCode   = Convert.ToInt64(Session["ID_Agent"]);
            ObjBlAgent.FK_Company = Convert.ToInt64(Session["ID_Company"]);
            ObjBlAgent.MasterID   = Convert.ToInt64(Session["ID_Agent"]);

            BlFunction blfunctions     = new BlFunction();
            string     CurrentPassword = "";

            CurrentPassword            = blfunctions.EncryptAgent(Convert.ToString(ObjBlAgent.CurrentPassword.Trim()));
            ObjBlAgent.CurrentPassword = CurrentPassword;

            string AgentPassword = "";

            AgentPassword         = blfunctions.EncryptAgent(Convert.ToString(ObjBlAgent.AgPassword.Trim()));
            ObjBlAgent.AgPassword = AgentPassword;

            blfunctions = null;

            long statusCode = 0;

            if (ObjBlAgent.MasterID == 0)
            {
                statusCode = ObjBlAgent.ChangePassword();
            }
            else
            {
                statusCode = ObjBlAgent.ChangePassword();
            }

            ObjBlAgent = null;
            return(Json(new { statusCode = "" + statusCode + "" }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ActionResult UpdateUser(BlUser ObjBlUser)
        {
            ObjBlUser.UserCode   = Convert.ToInt64(Session["ID_Agent"]);
            ObjBlUser.FK_Company = Convert.ToInt64(Session["ID_Company"]);

            BlFunction blfunctions   = new BlFunction();
            string     AgentPassword = "";

            AgentPassword        = blfunctions.EncryptAgent(Convert.ToString(ObjBlUser.UsPassword.Trim()));
            ObjBlUser.UsPassword = AgentPassword;
            blfunctions          = null;

            long statusCode = 0;

            if (ObjBlUser.MasterID == 0)
            {
                statusCode = ObjBlUser.InsertData();
            }
            else
            {
                statusCode = ObjBlUser.UpdateData();
            }

            ObjBlUser = null;
            return(Json(new { statusCode = "" + statusCode + "" }, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        public JsonResult UserLoginCheck(BlUser ObjBlUser)
        {
            try
            {
                BlFunction blfunctions  = new BlFunction();
                string     UserPassword = "";
                UserPassword         = blfunctions.EncryptAgent(Convert.ToString(ObjBlUser.UsPassword.Trim()));
                ObjBlUser.UsPassword = UserPassword;


                ArrayList arrlist = ObjBlUser.ValidLogin();
                blfunctions = null;
                ObjBlUser   = null;


                if (arrlist.Count > 0)
                {
                    Session["ID_Users"]   = arrlist[0].ToString();
                    Session["ID_Company"] = arrlist[1].ToString();
                    Session["UsName"]     = arrlist[3].ToString();
                    //ViewData["ReplayCount"] = arrlist[6].ToString();
                    if (Session["ID_Users"] != null && Convert.ToString(Session["ID_Users"]) != "" &&
                        Session["ID_Company"] != null && Convert.ToString(Session["ID_Company"]) != "")
                    {
                        return(Json(new { Url = Url.Action("UserDashboard", "UserDashboard"), statusCode = 1 }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { Url = Url.Action("UserLogin", "Home"), statusCode = 2 }, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    return(Json(new { Url = Url.Action("UserLogin", "Home"), statusCode = 2 }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(ex));
            }
        }
예제 #4
0
        public JsonResult AgentloginCheck(BlAgent ObjBlAgent)
        {
            try
            {
                BlFunction blfunctions   = new BlFunction();
                string     AgentPassword = "";
                AgentPassword         = blfunctions.EncryptAgent(Convert.ToString(ObjBlAgent.AgPassword.Trim()));
                ObjBlAgent.AgPassword = AgentPassword;


                ArrayList arrlist = ObjBlAgent.ValidLogin();
                blfunctions = null;
                ObjBlAgent  = null;


                if (arrlist.Count > 0)
                {
                    Session["ID_Agent"]   = arrlist[0].ToString();
                    Session["ID_Company"] = arrlist[1].ToString();
                    Session["AgName"]     = arrlist[3].ToString();
                    if (Session["ID_Agent"] != null && Convert.ToString(Session["ID_Agent"]) != "" &&
                        Session["ID_Company"] != null && Convert.ToString(Session["ID_Company"]) != "")
                    {
                        return(Json(new { Url = Url.Action("RecruitersDashboard", "Recruiters"), statusCode = 1 }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { Url = Url.Action("RecruitersLogin", "Home"), statusCode = 2 }, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    return(Json(new { Url = Url.Action("RecruitersLogin", "Home"), statusCode = 2 }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(ex));
            }
        }