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));
        }
        public JsonResult FillAgent(Int64 ID_Agent)
        {
            try
            {
                DataSet   ds      = new DataSet();
                DataTable dtbl    = new DataTable();
                BlAgent   blagent = new BlAgent();
                blagent.UserCode   = Convert.ToInt64(Session["ID_Agent"]);
                blagent.FK_Company = Convert.ToInt64(Session["ID_Company"]);
                blagent.MasterID   = ID_Agent;
                ds = blagent.SelectAllData();
                DataTable  Dt          = ds.Tables[0];
                DataTable  Dt1         = ds.Tables[1];
                BlFunction blfunctions = new BlFunction();
                Dt.Rows[0]["AgPassword"] = blfunctions.DecryptAgent(Convert.ToString(Dt.Rows[0]["AgPassword"].ToString()));
                blfunctions = null;



                return(Json(new { table = "" + Converttojson(Dt) + "", table1 = "" + Converttojson(Dt1) + "" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(ex));
            }
        }
        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));
        }
Example #4
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));
            }
        }
Example #5
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));
            }
        }
        public JsonResult FillUser(Int64 ID_User)
        {
            try
            {
                DataTable dtbl   = new DataTable();
                BlUser    blUser = new BlUser();
                blUser.UserCode   = Convert.ToInt64(Session["ID_Agent"]);
                blUser.FK_Company = Convert.ToInt64(Session["ID_Company"]);
                blUser.MasterID   = ID_User;
                dtbl = blUser.SelectAllData();

                BlFunction blfunctions = new BlFunction();
                dtbl.Rows[0][6] = blfunctions.DecryptAgent(Convert.ToString(dtbl.Rows[0][6].ToString()));
                blfunctions     = null;

                return(Json(Converttojson(dtbl), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(ex));
            }
        }