Commit 5f9aa229 by Ajeet Kumar

27-09-2019

parent 75c83b20
...@@ -20,8 +20,10 @@ namespace EnvigoHiring.Models.Applicants ...@@ -20,8 +20,10 @@ namespace EnvigoHiring.Models.Applicants
public string Position { get; set; } public string Position { get; set; }
public string Email { get; set; } public string Email { get; set; }
public string ContactNo { get; set; } public string ContactNo { get; set; }
[Required(ErrorMessage ="Alert! Notice period should not be empty")] [Required(ErrorMessage ="Alert! Notice period should not be empty")]
public int NoticePeriod { get; set; } public int NoticePeriod { get; set; }
[Range(1, 100000000, ErrorMessage = "Alert! Current Salary should be greater then 0")]
[Required(ErrorMessage = "Alert! Current Salary should not be empty")] [Required(ErrorMessage = "Alert! Current Salary should not be empty")]
public double CurrentSalary { get; set; } public double CurrentSalary { get; set; }
public double ExpectedSalary { get; set; } public double ExpectedSalary { get; set; }
...@@ -29,8 +31,11 @@ namespace EnvigoHiring.Models.Applicants ...@@ -29,8 +31,11 @@ namespace EnvigoHiring.Models.Applicants
public string LastAppraised { get; set; } public string LastAppraised { get; set; }
public string ddlBuyOut { get; set; } public string ddlBuyOut { get; set; }
public double BuyOutCost { get; set; } public double BuyOutCost { get; set; }
[Required(ErrorMessage = "Alert! Select interview round")]
public string ddlInterviewRound { get; set; } public string ddlInterviewRound { get; set; }
//[Required(ErrorMessage = "Alert! Interviewer date should not be empty")]
public string Interviewdate { get; set; } public string Interviewdate { get; set; }
[Required(ErrorMessage = "Alert! Select Interviewer")]
public string Interviewer { get; set; } public string Interviewer { get; set; }
public string ddlInterviewStage { get; set; } public string ddlInterviewStage { get; set; }
public bool HideInterview { get; set; } public bool HideInterview { get; set; }
...@@ -45,7 +50,9 @@ namespace EnvigoHiring.Models.Applicants ...@@ -45,7 +50,9 @@ namespace EnvigoHiring.Models.Applicants
,round.SheduledOn,apl.Stage from tblSuggestedApplicants sa left outer join tblApplicants apl on (sa.Candidate=apl.CandidateID) ,round.SheduledOn,apl.Stage from tblSuggestedApplicants sa left outer join tblApplicants apl on (sa.Candidate=apl.CandidateID)
left outer join tblInterviewRounds round on (apl.ApplicantID=round.ApplicantID) left outer join tblInterviewRounds round on (apl.ApplicantID=round.ApplicantID)
inner join vwPosition pos on (sa.PositionID=pos.PositionID) inner join tblMasterCandidatePool cand on inner join vwPosition pos on (sa.PositionID=pos.PositionID) inner join tblMasterCandidatePool cand on
(sa.Candidate=cand.CandidateID) where sa.CurrentStatus='Approve' and sa.Candidate={0} and apl.PositionID={1} order by round.roundtype desc", CandidateID, PositionID); (sa.Candidate=cand.CandidateID) where sa.CurrentStatus='Approve' and sa.Candidate={0} and sa.PositionID={1}
and (apl.PositionID=(select IIF(EXISTS(SELECT 1 FROM tblApplicants where PositionID = sa.PositionID and candidateID=sa.Candidate), sa.PositionID, (select top 1 PositionID from tblApplicants where CandidateID=1 order by createdate desc))) or apl.positionID is null)
order by round.roundtype desc", CandidateID, PositionID);
DataTable dt = obj.SelectDatatable(query); DataTable dt = obj.SelectDatatable(query);
if (dt != null && dt.Rows.Count > 0) if (dt != null && dt.Rows.Count > 0)
{ {
...@@ -72,7 +79,7 @@ namespace EnvigoHiring.Models.Applicants ...@@ -72,7 +79,7 @@ namespace EnvigoHiring.Models.Applicants
Interviewer = row.SetParamValue("Interviewer"); Interviewer = row.SetParamValue("Interviewer");
ddlInterviewStage = row.SetParamValue("Stage"); ddlInterviewStage = row.SetParamValue("Stage");
} }
if (ddlInterviewRound!=null && ddlInterviewRound != "") if (ddlInterviewRound!=null && ddlInterviewRound != "" && ApplicantID>0)
{ {
HideInterview = true; HideInterview = true;
} }
...@@ -91,6 +98,13 @@ namespace EnvigoHiring.Models.Applicants ...@@ -91,6 +98,13 @@ namespace EnvigoHiring.Models.Applicants
validate vm = new validate(); validate vm = new validate();
vm = ValidationFunc.ValidateModelData<ApplicantsDetail>(this, "NoticePeriod", "CurrentSalary", "ExpectedSalary", vm = ValidationFunc.ValidateModelData<ApplicantsDetail>(this, "NoticePeriod", "CurrentSalary", "ExpectedSalary",
"Hikepercentage", "LastAppraised", "ddlBuyOut", "BuyOutCost", "ddlInterviewRound", "Interviewdate", "Interviewer"); "Hikepercentage", "LastAppraised", "ddlBuyOut", "BuyOutCost", "ddlInterviewRound", "Interviewdate", "Interviewer");
vm.isValid = true;
if (!CheckFunc.IsDate(LastAppraised))
{
vm.isValid = false;
vm.Message = "Alert! Last Appraised is not valid datetime type";
}
if (HideInterview==false && !CommonFunctions.IsDate(Interviewdate)) if (HideInterview==false && !CommonFunctions.IsDate(Interviewdate))
{ {
vm.isValid = false; vm.isValid = false;
...@@ -101,7 +115,19 @@ namespace EnvigoHiring.Models.Applicants ...@@ -101,7 +115,19 @@ namespace EnvigoHiring.Models.Applicants
vm.isValid = false; vm.isValid = false;
vm.Message = "Alert! Fill either excpected salary or hike percentage"; vm.Message = "Alert! Fill either excpected salary or hike percentage";
} }
if (ddlInterviewRound != null && ddlInterviewRound != "")
{
if (Interviewdate == null || Interviewdate == "")
{
vm.isValid = false;
vm.Message = "Alert! Interview date should not be blank";
}
if (!CheckFunc.IsDate(Interviewdate))
{
vm.isValid = false;
vm.Message = "Alert! Interview date is not valid datetime type";
}
}
return vm; return vm;
} }
public SaveData Save() public SaveData Save()
......
...@@ -19,7 +19,7 @@ namespace EnvigoHiring.Models.CandidatePool ...@@ -19,7 +19,7 @@ namespace EnvigoHiring.Models.CandidatePool
[Required(ErrorMessage = "Required! Select gender")] [Required(ErrorMessage = "Required! Select gender")]
public string Gender { get; set; } public string Gender { get; set; }
[Required(ErrorMessage = "Required! Candidate Experience should not be empty")] [Required(ErrorMessage = "Required! Candidate Experience should not be empty")]
public Double Experience { get; set; } public double Experience { get; set; }
[RegularExpression(@"^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$", ErrorMessage = "Alert! Invalid email address!")] [RegularExpression(@"^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$", ErrorMessage = "Alert! Invalid email address!")]
[Required(ErrorMessage = "Required! Email address should not be empty")] [Required(ErrorMessage = "Required! Email address should not be empty")]
public string EmailID { get; set; } public string EmailID { get; set; }
......
...@@ -22,7 +22,7 @@ namespace EnvigoHiring.Models.CandidateSelection ...@@ -22,7 +22,7 @@ namespace EnvigoHiring.Models.CandidateSelection
DataLayer obj = DataLayer.Instance; DataLayer obj = DataLayer.Instance;
public void FillData() public void FillData()
{ {
string query = "Select t1.positionID,DepartmentName,DesignationName,candidate from tblSuggestedApplicants t right outer join vwPosition t1 on (t.PositionID=t1.PositionID) where t1.JDStatus>0 and t1.PositionID=" + PositionID; string query = "Select t1.positionID,DepartmentName,DesignationName,candidate from tblSuggestedApplicants t right outer join vwPosition t1 on (t.PositionID=t1.PositionID) where t1.JDStatus>0 and t1.PositionID=" + PositionID;
dtSelectedCandidate = obj.SelectDatatable(query); dtSelectedCandidate = obj.SelectDatatable(query);
if (dtSelectedCandidate != null && dtSelectedCandidate.Rows.Count > 0) if (dtSelectedCandidate != null && dtSelectedCandidate.Rows.Count > 0)
{ {
...@@ -64,7 +64,7 @@ namespace EnvigoHiring.Models.CandidateSelection ...@@ -64,7 +64,7 @@ namespace EnvigoHiring.Models.CandidateSelection
tblMasterDepartment AS t2 ON t.InterestedDepartmentID = t2.DepartmentID left outer join tblApplicants apl on (t1.PositionID=apl.PositionID and t.CandidateID=apl.CandidateID) tblMasterDepartment AS t2 ON t.InterestedDepartmentID = t2.DepartmentID left outer join tblApplicants apl on (t1.PositionID=apl.PositionID and t.CandidateID=apl.CandidateID)
left outer join (select rounds.ApplicantID,SheduledOn,InterviewStatus,PositionID,Rank() over (Partition BY PositionID,rounds.CandidateID ORDER BY rounds.Createdate desc ) AS Rank from tblInterviewRounds rounds left outer join (select rounds.ApplicantID,SheduledOn,InterviewStatus,PositionID,Rank() over (Partition BY PositionID,rounds.CandidateID ORDER BY rounds.Createdate desc ) AS Rank from tblInterviewRounds rounds
inner join tblapplicants apl on (rounds.ApplicantID=apl.ApplicantID) ) as r on (apl.ApplicantID=r.ApplicantID) left outer join tblMasterInterviewStatus mis on (r.InterviewStatus=mis.InterviewStatusID) inner join tblapplicants apl on (rounds.ApplicantID=apl.ApplicantID) ) as r on (apl.ApplicantID=r.ApplicantID) left outer join tblMasterInterviewStatus mis on (r.InterviewStatus=mis.InterviewStatusID)
WHERE (t1.PositionID = {0}) and (rank=1 or rank is null)", PositionID); WHERE (t1.PositionID = {0}) and t1.CurrentStatus<>'Reject' and (rank=1 or rank is null)", PositionID);
return obj.SelectDatatable(query); return obj.SelectDatatable(query);
} }
public void ApproveCand(int CandID) public void ApproveCand(int CandID)
......
...@@ -1019,7 +1019,7 @@ System.UInt32 dwReserverd); ...@@ -1019,7 +1019,7 @@ System.UInt32 dwReserverd);
// smtp.UseDefaultCredentials = false; // smtp.UseDefaultCredentials = false;
try try
{ {
smtp.Send(Msg); //smtp.Send(Msg);
//Msg.Dispose(); //Msg.Dispose();
i = 1; i = 1;
......
...@@ -74,16 +74,50 @@ namespace CommonFunc ...@@ -74,16 +74,50 @@ namespace CommonFunc
string ErrorMessage = (attr.GetType().GetProperty("ErrorMessage") != null) ? Convert.ToString(attr.GetType().GetProperty("ErrorMessage").GetValue(attr, null)) : ""; string ErrorMessage = (attr.GetType().GetProperty("ErrorMessage") != null) ? Convert.ToString(attr.GetType().GetProperty("ErrorMessage").GetValue(attr, null)) : "";
//required field validator //required field validator
if (datatype.ToLower() == "int")
{
if (!CheckFunc.IsNumeric(values))
{
conds += "<li>" + VariableName + ": is not numeric</li>";
result = false;
}
}
if (datatype.ToLower() == "double" || datatype.ToLower() == "float")
{
if (!CheckFunc.IsDouble(values))
{
conds += "<li>" + VariableName + ": is not decimal or integer</li>";
result = false;
}
}
if (attr is RequiredAttribute) if (attr is RequiredAttribute)
{ {
if (values == null || values == "") if (values == null || values == "")
{ {
conds += "<li>" + VariableName + ":" + ErrorMessage + "</li>"; conds += "<li>" + VariableName + ": " + ErrorMessage + "</li>";
result = false; result = false;
} }
if (datatype.ToLower() == "int")
{
if (Convert.ToInt32(values) <= 0)
{
conds += "<li>" + VariableName + ": " + ErrorMessage + "</li>";
result = false;
}
}
if (datatype.ToLower() == "double")
{
if (Convert.ToDouble(values) <= 0)
{
conds += "<li>" + VariableName + ": " + ErrorMessage + "</li>";
result = false;
}
}
} }
//if Variable declared with [AllowHtml] //if Variable declared with [AllowHtml]
if (isHtmlAttribute==true) if (isHtmlAttribute == true)
{ {
if (!SpecialCharacterFunc.TextAreaString(HttpUtility.HtmlDecode(values))) if (!SpecialCharacterFunc.TextAreaString(HttpUtility.HtmlDecode(values)))
{ {
...@@ -121,20 +155,6 @@ namespace CommonFunc ...@@ -121,20 +155,6 @@ namespace CommonFunc
} }
} }
} }
if (datatype.ToLower() == "int")
{
if (!CheckFunc.IsNumeric(values))
{
conds += "<li>" + VariableName + ": number is not numeric</li>";
}
}
if (datatype.ToLower() == "double")
{
if (!CheckFunc.IsDouble(values))
{
conds += "<li>" + VariableName + ": Number is not decimal or integer</li>";
}
}
if (attr is RangeAttribute) if (attr is RangeAttribute)
{ {
if (Int32.Parse(values) < Int32.Parse((attr as RangeAttribute).Minimum.ToString()) && Int32.Parse(values) > Int32.Parse((attr as RangeAttribute).Minimum.ToString())) if (Int32.Parse(values) < Int32.Parse((attr as RangeAttribute).Minimum.ToString()) && Int32.Parse(values) > Int32.Parse((attr as RangeAttribute).Minimum.ToString()))
...@@ -165,7 +185,7 @@ namespace CommonFunc ...@@ -165,7 +185,7 @@ namespace CommonFunc
{ {
if (!CheckFunc.IsEmail(values)) if (!CheckFunc.IsEmail(values))
{ {
conds += "<li>" + VariableName + ":" + ErrorMessage + "</li>"; conds += "<li>" + VariableName + ": " + ErrorMessage + "</li>";
result = false; result = false;
} }
} }
...@@ -179,7 +199,7 @@ namespace CommonFunc ...@@ -179,7 +199,7 @@ namespace CommonFunc
Match m = Regex.Match(values, @"" + pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); Match m = Regex.Match(values, @"" + pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
if (m.Success == false) if (m.Success == false)
{ {
conds += "<li>" + VariableName + ":" + ErrorMessage + "</li>"; conds += "<li>" + VariableName + ": " + ErrorMessage + "</li>";
result = false; result = false;
} }
} }
...@@ -190,7 +210,7 @@ namespace CommonFunc ...@@ -190,7 +210,7 @@ namespace CommonFunc
bool results = lengthValidate(values, (attr as StringLengthAttribute).MinimumLength, (attr as StringLengthAttribute).MaximumLength); bool results = lengthValidate(values, (attr as StringLengthAttribute).MinimumLength, (attr as StringLengthAttribute).MaximumLength);
if (results == false) if (results == false)
{ {
conds += "<li>" + VariableName + ":" + ErrorMessage + "</li>"; conds += "<li>" + VariableName + ": " + ErrorMessage + "</li>";
result = false; result = false;
} }
} }
...@@ -200,7 +220,7 @@ namespace CommonFunc ...@@ -200,7 +220,7 @@ namespace CommonFunc
} }
// Add all validation error // Add all validation error
if (conds.Length > 0) if (conds.Length > 0)
Message += String.Format("\n\t {0} <br/>", conds); Message += String.Format("{0}", conds);
} }
vm.isValid = result; vm.isValid = result;
vm.Message = Message; vm.Message = Message;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
public static class CheckBoxList
{
public static MvcHtmlString CheckBoxListFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> SelectedItem, List<SelectListItem> list)
{
var sb = new StringBuilder();
string selected = "";
if (list != null)
{
int i = 0;
foreach (var l in list)
{
string collectionNameIndex = String.Format("{0}[{1}]", SelectedItem.Name, i);
var hiddenName = new TagBuilder("input");
hiddenName.Attributes.Add(new KeyValuePair<string, string>("type", "hidden"));
hiddenName.Attributes.Add(new KeyValuePair<string, string>("name", String.Format("{0}.{1}", collectionNameIndex, "Text")));
hiddenName.Attributes.Add(new KeyValuePair<string, string>("value", l.Text));
var hiddenValue = new TagBuilder("input");
hiddenValue.Attributes.Add(new KeyValuePair<string, string>("type", "hidden"));
hiddenValue.Attributes.Add(new KeyValuePair<string, string>("name", String.Format("{0}.{1}", collectionNameIndex, "Value")));
hiddenValue.Attributes.Add(new KeyValuePair<string, string>("value", l.Value));
string ID = ("," + SelectedItem.ToString() + ",").Contains("," + l.Value + ",") ? l.Value + "," : "";
var checkBoxTag = htmlHelper.CheckBox(String.Format("{0}.{1}", collectionNameIndex, "Selected"), ID==""?false:true);
selected += ("," + SelectedItem.ToString() + ",").Contains("," + l.Value + ",") ? l.Value+"," : "";
var labelTag = new TagBuilder("label");
labelTag.Attributes.Add(new KeyValuePair<string, string>("for", String.Format("{0}.{1}", collectionNameIndex, "Name")));
labelTag.SetInnerText(l.Text);
sb.Append(hiddenName);
sb.Append(hiddenValue);
sb.Append(checkBoxTag);
sb.Append(labelTag);
sb.Append("<br/>");
i++;
}
}
//selected= selected?.Substring(0, selected.Length - 1)??"";
return MvcHtmlString.Create(sb.ToString());
//var antiForgeryInputTag = helper.AntiForgeryToken().ToString();
//// Above gets the following: <input name="__RequestVerificationToken" type="hidden" value="PnQE7R0MIBBAzC7SqtVvwrJpGbRvPgzWHo5dSyoSaZoabRjf9pCyzjujYBU_qKDJmwIOiPRDwBV1TNVdXFVgzAvN9_l2yt9-nf4Owif0qIDz7WRAmydVPIm6_pmJAI--wvvFQO7g0VvoFArFtAR2v6Ch1wmXCZ89v0-lNOGZLZc1" />
//var removedStart = antiForgeryInputTag.Replace(@"<input name=""__RequestVerificationToken"" type=""hidden"" value=""", "");
//var tokenValue = removedStart.Replace(@""" />", "");
//if (antiForgeryInputTag == removedStart || removedStart == tokenValue)
// throw new InvalidOperationException("Oops! The Html.AntiForgeryToken() method seems to return something I did not expect.");
////return new MvcHtmlString(string.Format(@"{0}:""{1}""", "__RequestVerificationToken", tokenValue));
//return new MvcHtmlString(string.Format("{0}", tokenValue));
}
}
...@@ -29,10 +29,9 @@ namespace EnvigoHiring.Models.Position ...@@ -29,10 +29,9 @@ namespace EnvigoHiring.Models.Position
public string RequestDate { get; set; } public string RequestDate { get; set; }
[Required(ErrorMessage = "Alert! ClosedBy Date should not be blank")] [Required(ErrorMessage = "Alert! ClosedBy Date should not be blank")]
public string ClosedByDate { get; set; } public string ClosedByDate { get; set; }
[Required(ErrorMessage = "Alert! Experience should not be blank")] [Required(ErrorMessage = "Alert! Experience should be grater then 0")]
public double Experience { get; set; } public double Experience { get; set; }
[Required(ErrorMessage = "Alert! Yearly Salary Budget should not be blank")]
[RegularExpression(@"^[0-9.]+$", ErrorMessage = "Alert! Yearly Salary Budget Should be numeric")]
public double YearlySalaryBudget { get; set; } public double YearlySalaryBudget { get; set; }
public string Status { get; set; } public string Status { get; set; }
public List<SelectListItem> Designation { get; set; } public List<SelectListItem> Designation { get; set; }
...@@ -188,6 +187,22 @@ namespace EnvigoHiring.Models.Position ...@@ -188,6 +187,22 @@ namespace EnvigoHiring.Models.Position
sv.isSuccess = true; sv.isSuccess = true;
sv.Message = "<b>Success :</b> Page updated successfully."; sv.Message = "<b>Success :</b> Page updated successfully.";
//Send Mail
string emails = CommonFunctions.getadminemailid(4);
if (emails.Length > 0)
{
string FileName = AppDomain.CurrentDomain.BaseDirectory + "content\\mailer.html";
System.IO.StreamReader ObjStrmRdr;
ObjStrmRdr = System.IO.File.OpenText(FileName);
string StrMail = ObjStrmRdr.ReadToEnd();
StrMail = StrMail.Replace("$$Heading$$", "Existing Position updated!");
StrMail = StrMail.Replace("$$Content$$", "Dear Recruiter,<br/><br/> Existing position has been updated by " + Users.LoginDetail().UserName.ToString().Trim() + " on <b>Envigo Hiring</b> application, Position TAT date is " + GetTAT().ToString("MM/dd/yyyy") + ". <a href='" + ConfigurationManager.AppSettings["SiteUrl"] + "' target=_blank>Click here</a> to review.");
ObjStrmRdr.Close();
CommonFunctions.Email_Send("Existing Position Updated - Envigo Hiring", emails, StrMail);
}
//End Send Email
return sv; return sv;
} }
} }
...@@ -214,20 +229,21 @@ namespace EnvigoHiring.Models.Position ...@@ -214,20 +229,21 @@ namespace EnvigoHiring.Models.Position
{ {
string subquery = (Users.LoginDetail().Roles == "User") ? "and t.RequesterID=" + UserID.ToInt32() : ""; string subquery = (Users.LoginDetail().Roles == "User") ? "and t.RequesterID=" + UserID.ToInt32() : "";
string query = string.Format(@"select PositionID,DepartmentName,DesignationName,UnitName,Priority,TAT,ClosedByDate, t.status ,t.Experience,t.YearlySalaryBudget string query = string.Format(@"select PositionID,DepartmentName,DesignationName,UnitName,Priority,TAT,ClosedByDate, t.status ,t.Experience,t.YearlySalaryBudget
,(select count(1) from tblSuggestedApplicants where positionid=t.positionid) as Tcount ,(select count(1) from tblSuggestedApplicants where positionid=t.positionid) as Tcount,u.username
,(select count(1) from tblSuggestedApplicants where currentstatus='Approve' and positionid=t.positionid) as TApprvcount from tblPositions t ,(select count(1) from tblSuggestedApplicants where currentstatus='Approve' and positionid=t.positionid) as TApprvcount from tblPositions t
inner join tblMasterDepartment dept on (t.Department=dept.DepartmentID) inner join tblMasterDesignation desg on (t.DesignationID=desg.DesignationID) inner join tblMasterDepartment dept on (t.Department=dept.DepartmentID) inner join tblMasterDesignation desg on (t.DesignationID=desg.DesignationID)
inner join tblMasterUnit unt on (t.Unit=unt.unitID) where (t.status='Open' or t.status='ReOpen') {0} order by t.RequestDate desc", subquery); inner join tblMasterUnit unt on (t.Unit=unt.unitID) inner join tblUserLogin u on (t.RequesterID=u.UserID) where (t.status='Open' or t.status='ReOpen') {0} order by t.RequestDate desc", subquery);
return obj.SelectDatatable(query); return obj.SelectDatatable(query);
} }
public DataTable viewInActivePosition() public DataTable viewInActivePosition()
{ {
string subquery =(Users.LoginDetail().Roles=="User")? "and t.RequesterID="+UserID.ToInt32():""; string subquery =(Users.LoginDetail().Roles=="User")? "and t.RequesterID="+UserID.ToInt32():"";
string query = string.Format(@"select PositionID,DepartmentName,DesignationName,UnitName,Priority,TAT,ClosedByDate, t.status ,t.Experience,t.YearlySalaryBudget string query = string.Format(@"select PositionID,DepartmentName,DesignationName,UnitName,Priority,TAT,ClosedByDate, t.status ,t.Experience,t.YearlySalaryBudget,
,(select count(1) from tblSuggestedApplicants where currentstatus='selected' and positionid=t.positionid) as Tcount (select name from tblMasterCandidatePool where candidateID=t.SelectedCandidateID) as selectedCandidate
,(select count(1) from tblSuggestedApplicants where currentstatus='selected' and positionid=t.positionid) as Tcount,u.username,t.Closure_Date
,(select count(1) from tblSuggestedApplicants where currentstatus='Approve' and positionid=t.positionid) as TApprvcount from tblPositions t ,(select count(1) from tblSuggestedApplicants where currentstatus='Approve' and positionid=t.positionid) as TApprvcount from tblPositions t
inner join tblMasterDepartment dept on (t.Department=dept.DepartmentID) inner join tblMasterDesignation desg on (t.DesignationID=desg.DesignationID) inner join tblMasterDepartment dept on (t.Department=dept.DepartmentID) inner join tblMasterDesignation desg on (t.DesignationID=desg.DesignationID)
inner join tblMasterUnit unt on (t.Unit=unt.unitID) where (t.status!='Open' and t.status!='ReOpen') {0} order by t.RequestDate desc", subquery); inner join tblMasterUnit unt on (t.Unit=unt.unitID) inner join tblUserLogin u on (t.RequesterID=u.UserID) where (t.status!='Open' and t.status!='ReOpen') {0} order by t.RequestDate desc", subquery);
return obj.SelectDatatable(query); return obj.SelectDatatable(query);
} }
public List<SelectListItem> DesignationList(string DepartmentID) public List<SelectListItem> DesignationList(string DepartmentID)
......
...@@ -400,7 +400,7 @@ $.extend($.validator, { ...@@ -400,7 +400,7 @@ $.extend($.validator, {
} else { } else {
this.invalid[element.name] = true; this.invalid[element.name] = true;
} }
if ( !this.numberOfInvalids() ) { if (!this.numberOfInvalids() ) {
// Hide error containers on last error // Hide error containers on last error
this.toHide = this.toHide.add( this.containers ); this.toHide = this.toHide.add( this.containers );
} }
...@@ -584,11 +584,22 @@ $.extend($.validator, { ...@@ -584,11 +584,22 @@ $.extend($.validator, {
return false; return false;
} }
} }
//Modification by Ajeet End //Modification by Ajeet End // check for integer validation
for (var method in rules ) { for (var method in rules ) {
var rule = { method: method, parameters: rules[method] }; var rule = { method: method, parameters: rules[method] };
try { try {
var v = rule["parameters"];
////Addd for Modification for integer type
//if (method == "number" && rule["parameters"] == true)
//{
// if (val == 0)
// {
// dependencyMismatch = true;
// continue;
// }
//}
//dependencyMismatch = false;
////Modification End
result = $.validator.methods[method].call( this, val, element, rule.parameters ); result = $.validator.methods[method].call( this, val, element, rule.parameters );
// if a method indicates that the field is optional and therefore valid, // if a method indicates that the field is optional and therefore valid,
......
...@@ -73,11 +73,11 @@ ...@@ -73,11 +73,11 @@
<tr> <tr>
<th>Last Appraised</th> <th>Last Appraised</th>
<td> <td>
<a>@Convert.ToDateTime(HttpUtility.HtmlDecode(dr["Last_Appraised_On"].ToString().Trim())).ToString("MMM yyyy")</a> <a>@((dr["Last_Appraised_On"]!=null && dr["Last_Appraised_On"].ToString() != "") ? Convert.ToDateTime(HttpUtility.HtmlDecode(dr["Last_Appraised_On"].ToString().Trim())).ToString("MMM yyyy"):"")</a>
</td> </td>
<th>Last Conatcted</th> <th>Last Conatcted</th>
<td> <td>
<a>@Convert.ToDateTime(HttpUtility.HtmlDecode(dr["Last_Appraised_On"].ToString().Trim())).ToString("dd MMM yy")</a> <a>@((dr["LastContactedDate"]!=null && dr["LastContactedDate"].ToString() != "") ?Convert.ToDateTime(HttpUtility.HtmlDecode(dr["LastContactedDate"].ToString().Trim())).ToString("dd MMM yy"):"")</a>
</td> </td>
</tr> </tr>
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
</tr> </tr>
<tr id="rating"> <tr id="rating">
<td colspan="2"> <td colspan="2">
<table> <table class="table table-striped table-bordered dataTable">
<tr> <tr>
<td>Comunication</td> <td>Comunication</td>
<td> <td>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
Candidate Name Candidate Name
</label> </label>
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-6 col-sm-6 col-xs-12">
@Html.TextBoxFor(m=>m.Applicant, new { @class= "form-control col-md-7 col-xs-12", @readonly="readonly" }) @Html.TextBoxFor(m => m.Applicant, new { @class = "form-control col-md-7 col-xs-12", @readonly = "readonly" })
</div> </div>
</div> </div>
<div class="item form-group"> <div class="item form-group">
...@@ -66,10 +66,10 @@ ...@@ -66,10 +66,10 @@
@Html.TextBoxFor(m => m.Email, new { @class = "form-control col-md-7 col-xs-12", @readonly = "readonly" }) @Html.TextBoxFor(m => m.Email, new { @class = "form-control col-md-7 col-xs-12", @readonly = "readonly" })
</div> </div>
</div> </div>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo"> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo">
Contact No Contact No
</label> </label>
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-6 col-sm-6 col-xs-12">
@Html.TextBoxFor(m => m.ContactNo, new { @class = "form-control col-md-7 col-xs-12", @readonly = "readonly" }) @Html.TextBoxFor(m => m.ContactNo, new { @class = "form-control col-md-7 col-xs-12", @readonly = "readonly" })
...@@ -110,18 +110,18 @@ ...@@ -110,18 +110,18 @@
</div> </div>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo"> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo">
Last Appraised On Last Appraised On
</label> </label>
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-6 col-sm-6 col-xs-12">
@Html.TextBoxFor(m => m.LastAppraised, new { @class = "form-control col-md-7 col-xs-12 MonthDatepicker", autofocus = "autofocus" }) @Html.TextBoxFor(m => m.LastAppraised, new { @class = "form-control col-md-7 col-xs-12 MonthDatepicker", autofocus = "autofocus",required="required" })
</div> </div>
</div> </div>
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo"> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo">
Is Buyout Is Buyout
</label> </label>
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-6 col-sm-6 col-xs-12">
@Html.DropDownListFor(m => m.ddlBuyOut,Model.BuyOutList(),"Select Buy Out", new { @class = "form-control col-md-7 col-xs-12", autofocus = "autofocus" }) @Html.DropDownListFor(m => m.ddlBuyOut, Model.BuyOutList(), "Select Buy Out", new { @class = "form-control col-md-7 col-xs-12", autofocus = "autofocus" })
</div> </div>
</div> </div>
<div class="item form-group"> <div class="item form-group">
...@@ -142,44 +142,50 @@ ...@@ -142,44 +142,50 @@
@Html.DropDownListFor(m => m.ddlInterviewStage, Model.IntervieweStageList(), new { @class = "form-control col-md-7 col-xs-12", autofocus = "autofocus" }) @Html.DropDownListFor(m => m.ddlInterviewStage, Model.IntervieweStageList(), new { @class = "form-control col-md-7 col-xs-12", autofocus = "autofocus" })
</div> </div>
</div> </div>
}
@Html.HiddenFor(m=>m.HideInterview)
if (Model.HideInterview == true)
{
Html.EnableClientValidation(false);
} }
if (Model.HideInterview == false) if (Model.HideInterview == false)
{ {
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo"> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo">
Interview Round Type<span class="required">*</span> Interview Round Type<span class="required">*</span>
</label> </label>
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-6 col-sm-6 col-xs-12">
@Html.DropDownListFor(m => m.ddlInterviewRound, Model.InterviewType(), "Select interview type", new { @class = "form-control col-md-7 col-xs-12", autofocus = "autofocus" }) @Html.DropDownListFor(m => m.ddlInterviewRound, Model.InterviewType(), "Select interview type", new { @class = "form-control col-md-7 col-xs-12", autofocus = "autofocus" })
</div>
</div> </div>
</div> <div class="item form-group">
<div class="item form-group"> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo"> Interview Date Time<span class="required">*</span>
Interview Date Time<span class="required">*</span> </label>
</label> <div class="col-md-6 col-sm-6 col-xs-12">
<div class="col-md-6 col-sm-6 col-xs-12"> @Html.TextBoxFor(m => m.Interviewdate, new { @class = "form-control col-md-7 col-xs-12 myDatepicker", autofocus = "autofocus", required="required" })
@Html.TextBoxFor(m => m.Interviewdate, new { @class = "form-control col-md-7 col-xs-12 myDatepicker", autofocus = "autofocus" }) </div>
</div> </div>
</div> <div class="item form-group">
<div class="item form-group"> <label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="ContactNo"> Interviewer<span class="required">*</span>
Interviewer<span class="required">*</span> </label>
</label> <div class="col-md-6 col-sm-6 col-xs-12">
<div class="col-md-6 col-sm-6 col-xs-12"> @Html.DropDownListFor(m => m.Interviewer, Model.InterviewerList(), "Select interviewer", new { @class = "form-control col-md-7 col-xs-12", autofocus = "autofocus" })
@Html.DropDownListFor(m => m.Interviewer, Model.InterviewerList(), "Select interviewer", new { @class = "form-control col-md-7 col-xs-12", autofocus = "autofocus" }) </div>
</div> </div>
</div>
} }
<div class="ln_solid"></div> <div class="ln_solid"></div>
<div class="form-group"> <div class="form-group">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<a type="submit" class="btn btn-primary" href="/candidateselection/select/@Model.PositionID">Cancel</a> <a type="submit" class="btn btn-primary" href="/candidateselection/select/@Model.PositionID">Cancel</a>
<button id="send" type="submit" name="btnSubmit" value="Submit" class="btn btn-success">Submit</button> <button id="send" type="submit" name="btnSubmit" value="Submit" class="btn btn-success btnsubmit">Submit</button>
</div> </div>
</div> </div>
@Html.HiddenFor(m=>m.HideInterview) @Html.HiddenFor(m => m.HideInterview)
} }
@section script{ @section script{
<script src="/Scripts/jquery.validate.js"></script> <script src="/Scripts/jquery.validate.js"></script>
...@@ -190,13 +196,14 @@ ...@@ -190,13 +196,14 @@
<script src="/vendors/bootstrap-daterangepicker/daterangepicker.js"></script> <script src="/vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<script src="/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script> <script src="/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="/vendors/tinymce/tinymce.min.js" type="text/javascript"></script> <script src="/vendors/tinymce/tinymce.min.js" type="text/javascript"></script>
<script> <script src="/vendors/custom.js"></script>
$('.myDatepicker').datetimepicker({minDate:-1 }); <script>
$('.MonthDatepicker').datetimepicker({ $('.myDatepicker').datetimepicker({ minDate: -1 });
format: 'MMM-YYYY' $('.MonthDatepicker').datetimepicker({
}); format: 'MMM-YYYY'
});
</script> </script>
@*@{ if (Html.ViewData.ModelState.IsValid) @*@{ if (Html.ViewData.ModelState.IsValid)
{ {
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<div class="form-group"> <div class="form-group">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<a class="btn btn-success" href="/position/viewposition">Cancel</a> <a class="btn btn-success" href="/position/viewposition">Cancel</a>
<button id="btnsubmit" type="submit" name="btnsubmit" value="Submit" class="btn btn-success">Submit</button> <button id="btnsubmit" type="submit" name="btnsubmit" value="Submit" class="btn btn-success btnsubmit">Submit</button>
@if (Model.JDStatus > 0) @if (Model.JDStatus > 0)
{ {
......
...@@ -30,23 +30,25 @@ ...@@ -30,23 +30,25 @@
<h2>View Manpower Requisition</h2> <h2>View Manpower Requisition</h2>
} }
<div class="x_content"> <div class="x_content">
@if (Model.dtPosition != null && Model.dtPosition.Rows.Count > 0)
{
<table id="datatable" class="table table-striped table-bordered"> <table id="datatable" class="table table-striped table-bordered">
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>Job</th> <th>Job</th>
<th>Priority</th> <th>Priority</th>
<th>Experience</th> <th>Exp</th>
<th>Budget</th> <th>Budget</th>
<th>TAT</th> <th>TAT</th>
<th>Closed Date</th> <th>Closed Date</th>
<th>Requester</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@if (Model.dtPosition != null && Model.dtPosition.Rows.Count > 0)
{ @foreach (System.Data.DataRow row in Model.dtPosition.Rows)
foreach (System.Data.DataRow row in Model.dtPosition.Rows)
{ {
int JDStatus = Model.JobDescriptionStatus(BasicFunc.SetParamValue(row, "PositionID")); int JDStatus = Model.JobDescriptionStatus(BasicFunc.SetParamValue(row, "PositionID"));
string role = Users.LoginDetail().Roles; string role = Users.LoginDetail().Roles;
...@@ -56,11 +58,15 @@ ...@@ -56,11 +58,15 @@
<tr> <tr>
<td>@Html.Raw(BasicFunc.SetParamValue(row, "PositionID"))</td> <td>@Html.Raw(BasicFunc.SetParamValue(row, "PositionID"))</td>
<td> <td>
<strong>Department:</strong> <strong>Department:</strong>
@Html.Raw(BasicFunc.SetParamValue(row, "DepartmentName")) @Html.Raw(BasicFunc.SetParamValue(row, "DepartmentName"))
<br /> <br />
<strong>Designation:</strong> @Html.Raw(BasicFunc.SetParamValue(row, "DesignationName"))<br /> <strong>Designation:</strong> @Html.Raw(BasicFunc.SetParamValue(row, "DesignationName"))<br />
<strong>Unit:</strong> @Html.Raw(BasicFunc.SetParamValue(row, "UnitName")) <strong>Unit:</strong> @Html.Raw(BasicFunc.SetParamValue(row, "UnitName"))
@*@if (row.SetParamValue("Status").ToLower() == "closed")
{
<strong>Selected Candidate:</strong>@row.SetParamValue("selectedCandidate")
}*@
</td> </td>
<td>@Html.Raw(BasicFunc.SetParamValue(row, "Priority"))</td> <td>@Html.Raw(BasicFunc.SetParamValue(row, "Priority"))</td>
...@@ -68,10 +74,11 @@ ...@@ -68,10 +74,11 @@
<td>@Budeget</td> <td>@Budeget</td>
<td>@Html.Raw(BasicFunc.SetParamValue(row, "TAT").ToDateTime().ToString("dd, MMM yyyy"))</td> <td>@Html.Raw(BasicFunc.SetParamValue(row, "TAT").ToDateTime().ToString("dd, MMM yyyy"))</td>
<td>@Html.Raw(BasicFunc.SetParamValue(row, "ClosedByDate").ToDateTime().ToString("dd, MMM yyyy"))</td> <td>@Html.Raw(BasicFunc.SetParamValue(row, "ClosedByDate").ToDateTime().ToString("dd, MMM yyyy"))</td>
<td>@row.SetParamValue("UserName")</td>
<td> <td>
@if (row.SetParamValue("status").ToLower() != "open" && row.SetParamValue("status").ToLower() != "reopen") @if (row.SetParamValue("status").ToLower() != "open" && row.SetParamValue("status").ToLower() != "reopen")
{ {
if (row.SetParamValue("status").ToLower() != "onhold" && row.SetParamValue("status").ToLower()!="closed") if (row.SetParamValue("status").ToLower() != "closed")
{ {
<a title='Edit Record' style='cursor:pointer;' href='/position/addposition/@row["PositionID"].ToString().Trim()'> <i class='fa fa-edit'></i></a> <a title='Edit Record' style='cursor:pointer;' href='/position/addposition/@row["PositionID"].ToString().Trim()'> <i class='fa fa-edit'></i></a>
} }
...@@ -84,9 +91,10 @@ ...@@ -84,9 +91,10 @@
</td> </td>
</tr> </tr>
} }
}
</tbody> </tbody>
</table> </table>
}
</div> </div>
@section script{ @section script{
......
...@@ -36,10 +36,11 @@ ...@@ -36,10 +36,11 @@
<th>ID</th> <th>ID</th>
<th>Job</th> <th>Job</th>
<th>Priority</th> <th>Priority</th>
<th>Experience</th> <th>Exp</th>
<th>Budget</th> <th>Budget</th>
<th>TAT</th> <th>TAT</th>
<th>Closed Date</th> <th>Closed Date</th>
<th>Requester</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
...@@ -97,6 +98,7 @@ ...@@ -97,6 +98,7 @@
<td>@Budeget</td> <td>@Budeget</td>
<td>@Html.Raw(BasicFunc.SetParamValue(row, "TAT").ToDateTime().ToString("dd, MMM yyyy"))</td> <td>@Html.Raw(BasicFunc.SetParamValue(row, "TAT").ToDateTime().ToString("dd, MMM yyyy"))</td>
<td>@Html.Raw(BasicFunc.SetParamValue(row, "ClosedByDate").ToDateTime().ToString("dd, MMM yyyy"))</td> <td>@Html.Raw(BasicFunc.SetParamValue(row, "ClosedByDate").ToDateTime().ToString("dd, MMM yyyy"))</td>
<td>@row.SetParamValue("UserName")</td>
<td> <td>
@if (row.SetParamValue("status").ToLower() == "open" || row.SetParamValue("status").ToLower() == "reopen") @if (row.SetParamValue("status").ToLower() == "open" || row.SetParamValue("status").ToLower() == "reopen")
{ {
......
...@@ -247,7 +247,12 @@ function ValidateCheckbox() ...@@ -247,7 +247,12 @@ function ValidateCheckbox()
} }
} }
} }
$(".btnsubmit").click(function () { $(".btnsubmit").click(function () {
$("[data-valmsg-summary=true]").find("ul").find("li").remove(); $("[data-valmsg-summary=true]").find("ul").find("li").remove();
$("[data-valmsg-summary=true]").addClass("alert-danger").addClass("in").removeClass("alert-success"); $("[data-valmsg-summary=true]").addClass("alert alert-danger").addClass("in").removeClass("alert-success");
});
$("button.close").click(function () {
$("[data-valmsg-summary=true]").find("ul").find("li").remove();
$("[data-valmsg-summary=true]").removeClass("alert");
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment