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 SelectAgentAll(string PageIndex = "1", string SearchItem = "") { try { DataSet ds = new DataSet(); int statusCode = 1; DataTable dtbl = new DataTable(); BlAgent blagent = new BlAgent(); blagent.UserCode = Convert.ToInt64(Session["ID_Agent"]); blagent.FK_Company = Convert.ToInt64(Session["ID_Company"]); blagent.AgCode = SearchItem; blagent.AgName = SearchItem; blagent.DepName = SearchItem; blagent.PageIndex = Convert.ToInt32(PageIndex); ds = blagent.SelectAllData(); DataTable Dt = ds.Tables[0]; return(Json(Converttojson(Dt), JsonRequestBehavior.AllowGet)); } catch (Exception ex) { /// return(Json(ex)); } }
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 JsonResult DeleteAgent(Int64 ID_Agent) { try { long statusCode = 0; BlAgent blagent = new BlAgent(); blagent.UserCode = Convert.ToInt64(Session["ID_Agent"]); blagent.FK_Company = Convert.ToInt64(Session["ID_Company"]); blagent.MasterID = ID_Agent; statusCode = blagent.DeleteData(); return(Json(new { statusCode = "" + statusCode + "" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(ex)); } }
public ActionResult UpdateAgentAccess(BlAgent ObjBlAgentAccess) { ObjBlAgentAccess.UserCode = Convert.ToInt64(Session["ID_Agent"]); ObjBlAgentAccess.FK_Company = Convert.ToInt64(Session["ID_Company"]); long statusCode = 0; if (ObjBlAgentAccess.MasterID == 0) { statusCode = ObjBlAgentAccess.InsertAgentAccess(); } else { statusCode = ObjBlAgentAccess.UpdateAgentAccess(); } ObjBlAgentAccess = null; return(Json(new { statusCode = "" + statusCode + "" }, JsonRequestBehavior.AllowGet)); }
public JsonResult SelectAgentDashBoard() { try { int statusCode = 1; DataTable dtbl = new DataTable(); BlAgent blagent = new BlAgent(); blagent.UserCode = Convert.ToInt64(Session["ID_Agent"]); blagent.FK_Company = Convert.ToInt64(Session["ID_Company"]); dtbl = blagent.SelectAgentDashBoard(); return(Json(Converttojson(dtbl), JsonRequestBehavior.AllowGet)); } catch (Exception ex) { /// return(Json(ex)); } }
public JsonResult FillAgentChangePassword() { 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 = Convert.ToInt64(Session["ID_Agent"]); ds = blagent.SelectAllData(); DataTable Dt = ds.Tables[0]; return(Json(Converttojson(Dt), JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(ex)); } }
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 SelectRecruitersStatusCount() { try { int statusCode = 1; DataSet dtbl = new DataSet(); BlAgent blagent = new BlAgent(); blagent.UserCode = Convert.ToInt64(Session["ID_Agent"]); blagent.FK_Company = Convert.ToInt64(Session["ID_Company"]); dtbl = blagent.SelectRecruitersStatusCount(); DataTable Dt = dtbl.Tables[0]; DataTable Dt1 = dtbl.Tables[1]; DataTable Dt2 = dtbl.Tables[2]; return(Json(new { table = "" + Converttojson(Dt) + "", table1 = "" + Converttojson(Dt1) + "", table2 = "" + Converttojson(Dt2) + "" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { /// return(Json(ex)); } }
public ActionResult UpdateTicketAssign(BlTickets ObjBlTickets) { DataSet ds = new DataSet(); DataSet ds1 = new DataSet(); ObjBlTickets.FK_Company = Convert.ToInt64(Session["ID_Company"]); ObjBlTickets.AgentCode = Convert.ToInt64(Session["ID_Agent"]); long statusCode = 0; statusCode = ObjBlTickets.UpdateTicketAssign(); try { BlAgent blAgent = new BlAgent(); blAgent.MasterID = ObjBlTickets.AgentCode; ds = blAgent.SelectAllData(); DataTable Dt = ds.Tables[0]; var Fromagent = Dt.Rows[0]["AgName"].ToString(); blAgent = null; BlAgent blAgentto = new BlAgent(); blAgentto.MasterID = ObjBlTickets.AgentTo; ds1 = blAgentto.SelectAllData(); DataTable Dt1 = ds1.Tables[0]; var toagent = Dt1.Rows[0]["AgName"].ToString(); List <string> toagentmailid = new List <string>(); toagentmailid.Add(Dt1.Rows[0]["Agemail"].ToString()); blAgentto = null; List <string> resumesids = new List <string>(); if (ObjBlTickets.MasterID != 0) { resumesids.Add(ObjBlTickets.MasterID.ToString()); } else { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(ObjBlTickets.XmlTickets); string xpath = "root/Tickets/ID_Tickets"; var nodes = xmlDoc.SelectNodes(xpath); foreach (XmlNode childrenNode in nodes) { resumesids.Add(childrenNode.InnerText); } } // DataTable dt2= ObjBlTickets.SelectAllData(); var resumeno = ""; ///dt2.Rows[0]["TickNo"].ToString(); //var candidatename = dt2.Rows[0]["CandidateName"].ToString(); string htmlbody = "<p><strong> SMART RECRUITER RESUME ASSIGNED </strong></p> <p>Hi " + toagent + ", </p>"; htmlbody += "<p><a href='" + ConfigurationManager.AppSettings["api-url"] + "/Resumes/Resumes'> Click here </a> to View All resumes</p>"; htmlbody += "<p>Please find this <strong>"; foreach (var res in resumesids) { htmlbody += "<a href='" + ConfigurationManager.AppSettings["api-url"] + "/Resumes/Resumes?ID_Resumes=" + res + "'> RESUME " + resumeno + "</a></strong><br/>"; } // htmlbody += " <p>Candidate Name : <strong>"+ candidatename + "</strong><br />"; htmlbody += "<br />"; htmlbody += "Assigned by : " + Fromagent + " in SmartRecruiter</p>"; SendMail("SMARTRECRUITER RESUME ASSIGNED", htmlbody, toagentmailid); } catch (Exception ex) { } ObjBlTickets = null; return(Json(new { statusCode = "" + statusCode + "" }, JsonRequestBehavior.AllowGet)); }