Transaction services
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using MIND.BusinessEntities;
using MIND.BusinessServices.Interface;
using MIND.Configuration;
using MIND.DAL;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace MIND.BusinessServices.Services
{
public class TransactionService : DataAccess, ITransactionService
{
public TransactionService(IConfiguration Configuration) : base(Configuration) { }
#region Employee Review Process
public async Task<EmployeeCompetencyTypeDetails> GetEmployeeCompetencyTypeDetails(Search Search)
{
Status Status = new Status();
EmployeeCompetencyTypeDetails ObjempDetails = new EmployeeCompetencyTypeDetails();
List<EmployeeCompetencyType> EmployeeList = new List<EmployeeCompetencyType>();
EmployeeCompetencyType EPMR = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@Type", Search.Type),
base.GetParameter("@ProcCode", Search.ProcCode),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataTable Dt = base.ExecuteDataTable(SPName.Get_EMP_CompetencyTypeDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
EPMR = new EmployeeCompetencyType
{
BaseClass = new BaseClass(),
CompetencyType = new CompetencyType(),
//EmpCompTypeId = DataRow["EMP_COMP_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_COMP_TYPE_ID"])),
//EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"])),
//EmpType = DataRow["EMP_TYPE"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_TYPE"])),
};
EPMR.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPT_TYPE_ID"]);
EPMR.CompetencyType.ComptTypeSeq = DataRow["OrderBy"] is DBNull ? default(int) : Convert.ToInt32(DataRow["OrderBy"]);
EPMR.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_DESC"] is DBNull ? default(string) : Convert.ToString(DataRow["COMPT_TYPE_DESC"]);
EPMR.CompetencyType.Weightage = DataRow["WEIGHTAGE"] is DBNull ? default(decimal) : Convert.ToDecimal(DataRow["WEIGHTAGE"]);
EPMR.CompetencyType.ComptTypeCode= DataRow["Code"] is DBNull ? default(string) : Convert.ToString(DataRow["Code"]);
EPMR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
EPMR.BaseClass.Year = new AppraisalYear();
EPMR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
// EPMR.BaseClass.Year.Year = DataRow["YEAR_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["YEAR_ID"]);
//EPMR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
//EPMR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
//EPMR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
//EPMR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
EPMR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
EmployeeList.Add(EPMR);
}
}
else
{
Status.Success = true;
Status.StateCode = 0;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjempDetails.EmployeeCompetencyType = EmployeeList;
ObjempDetails.Status = Status;
if (ObjempDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeCompetencyTypeDetails
{
Status = ObjempDetails.Status,
EmployeeCompetencyType = ObjempDetails.EmployeeCompetencyType,
});
}
public async Task<EmployeeIDPDetails> GetEmployeeIDPDetails(Search Search)
{
Status Status = new Status();
EmployeeIDPDetails objIDPDetails = new EmployeeIDPDetails();
List<EmployeeQuestions> objEmpQuestionsDetails = new List<EmployeeQuestions>();
EmployeeQuestions EOD = null;
List<DevelopmentPlan> objDevePlanDetails = new List<DevelopmentPlan>();
DevelopmentPlan DP = null;
List<DevelopmentTarget> objDevelopmentTarget = new List<DevelopmentTarget>();
DevelopmentTarget DT = null;
List<Component> objComplist = new List<Component>();
Component objcomp = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@ProcCode", Search.ProcCode),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpIDPReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
EOD = new EmployeeQuestions
{
baseClass = new BaseClass(),
ques = new Questions(),
emp = new Employee(),
mgremp = new Employee(),
EMPQTID = DataRow["EMP_QT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_QT_ID"])),
EmpComments = DataRow["Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Emp_Comments"])),
MgrComments = DataRow["Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mgr_Comments"])),
MidEmpComments = DataRow["Mid_Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Emp_Comments"])),
MidMgrComments = DataRow["Mid_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Mgr_Comments"])),
FinalEmpComments = DataRow["Final_Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Emp_Comments"])),
FinalMgrComments = DataRow["Final_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Mgr_Comments"])),
};
EOD.ques.QTID = DataRow["QT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["QT_ID"]));
EOD.ques.Desc = DataRow["QT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["QT_DESC"]));
//EOD.ques.IDP = new IDP();
//EOD.ques.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
//EOD.ques.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
//EOD.ques.IDP.Category = new Category();
//EOD.ques.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
//EOD.ques.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
//EOD.ques.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
EOD.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
// EOD.emp.EmpName = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
objEmpQuestionsDetails.Add(EOD);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
DT = new DevelopmentTarget
{
baseClass = new BaseClass(),
emp = new Employee(),
Mgremp = new Employee(),
IDP = new IDP(),
AssignmentRole = DataRow["Assignment_Role"] is DBNull ? default(string) : Convert.ToString((DataRow["Assignment_Role"])),
EMPDTID = DataRow["EMP_DT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_DT_ID"])),
Objective = DataRow["Objective"] is DBNull ? default(string) : Convert.ToString((DataRow["Objective"])),
Timing = DataRow["Timing"] is DBNull ? default(string) : Convert.ToString((DataRow["Timing"])),
SpecificsNotes = DataRow["Specifics_Notes"] is DBNull ? default(string) : Convert.ToString((DataRow["Specifics_Notes"])),
};
DT.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
//DT.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
//DT.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
//DT.IDP.Category = new Category();
//DT.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
//DT.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
//DT.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
objDevelopmentTarget.Add(DT);
}
}
if (ds.Tables[2].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[2].Rows)
{
DP = new DevelopmentPlan
{
baseClass = new BaseClass(),
emp = new Employee(),
Mgremp = new Employee(),
IDP = new IDP(),
DevelopmentAchieved = DataRow["Development_Achieved"] is DBNull ? default(string) : Convert.ToString((DataRow["Development_Achieved"])),
EMPDAPID = DataRow["EMP_DAP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_DAP_ID"])),
TobeComplete = DataRow["Tobe_Complete"] is DBNull ? default(string) : Convert.ToString((DataRow["Tobe_Complete"])),
Timing = DataRow["Timing"] is DBNull ? default(string) : Convert.ToString((DataRow["Timing"])),
MidtermStatus = DataRow["MidtermStatus"] is DBNull ? default(string) : Convert.ToString((DataRow["MidtermStatus"])),
FinalStatus = DataRow["FinalStatus"] is DBNull ? default(string) : Convert.ToString((DataRow["FinalStatus"])),
MidMgrComments = DataRow["Mid_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Mgr_Comments"])),
FinalMgrComments = DataRow["Final_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Mgr_Comments"])),
};
DP.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
//DP.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
//DP.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
//DP.IDP.Category = new Category();
//DP.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
//DP.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
//DP.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
objDevePlanDetails.Add(DP);
}
}
if (ds.Tables[3].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[3].Rows)
{
objcomp = new Component
{
BaseClass = new BaseClass(),
template = new TemplateMaster(),
CMId = DataRow["CM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CM_ID"])),
CmpCode = DataRow["Comp_Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Code"])),
CmpName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"])),
Description = DataRow["Comp_Desc"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Desc"])),
IsEmployeeVisible = DataRow["Is_EmployeeVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_EmployeeVisible"])),
IsManagerVisible = DataRow["Is_ManagerVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_ManagerVisible"])),
};
objcomp.template.TMId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
objcomp.template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
objcomp.template.Name = DataRow["TempName"] is DBNull ? default(string) : Convert.ToString((DataRow["TempName"]));
objComplist.Add(objcomp);
}
}
}
else
{
Status.Success = true;
Status.StateCode = 0;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
objIDPDetails.DevelopmentTarget = objDevelopmentTarget;
objIDPDetails.DevelopmentPlan = objDevePlanDetails;
objIDPDetails.EmployeeQuestions = objEmpQuestionsDetails;
objIDPDetails.Component = objComplist;
objIDPDetails.Status = Status;
if (objIDPDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeIDPDetails
{
Status = objIDPDetails.Status,
DevelopmentTarget = objIDPDetails.DevelopmentTarget,
DevelopmentPlan = objIDPDetails.DevelopmentPlan,
EmployeeQuestions = objIDPDetails.EmployeeQuestions,
Component = objIDPDetails.Component,
});
}
public async Task<EmployeeSectionReviwDetails> GetEmployeeKRADetails(Search Search)
{
Status Status = new Status();
EmployeeSectionReviwDetails ObjKraMappingDetails = new EmployeeSectionReviwDetails();
List<EmployeeComptencyReview> EmpKRAList = new List<EmployeeComptencyReview>();
List<Component> objComplist = new List<Component>();
Component objcomp = null;
EmployeeComptencyReview ECR = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpKRAReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ECR = new EmployeeComptencyReview
{
BaseClass = new BaseClass(),
Competency = new Competency(),
CompetencyType = new CompetencyType(),
CompetencyDetails = new CompetencyDetails(),
EmpReviewId = DataRow["EMP_REVIEW_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_REVIEW_ID"])),
};
ECR.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"]));
// ECR.CompetencyType.ComptTypeDesc = DataRow["COMPT_TYPE"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE"]));
ECR.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"]));
ECR.Competency.ComptmId = DataRow["COMPTM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTM_ID"]));
ECR.Competency.ComptShortDesc = DataRow["COMPTM_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPTM_SHORT_DESC"]));
ECR.CompetencyDetails.ComptdId = DataRow["COMPTD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTD_ID"]));
ECR.CompetencyDetails.ComptdDesc = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
ECR.EmpComptDesc = DataRow["EMPCOMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["EMPCOMPT_DESC"]));
ECR.ComptTarget = DataRow["COMPT_TARGET"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TARGET"]));
ECR.ComptWeightage = DataRow["COMPT_WEIGHTAGE"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["COMPT_WEIGHTAGE"]));
//Self end comments & rating
ECR.SelfComments = DataRow["SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["SELF_COMMENTS"]));
ECR.Appr1Comments = DataRow["APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["APPR1_COMMENTS"]));
//Mid Year end comments & rating
ECR.MidSelfComments = DataRow["MID_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_SELF_COMMENTS"]));
ECR.MidAppr1Comments = DataRow["MID_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_APPR1_COMMENTS"]));
ECR.MidSelfRating = new Rating();
ECR.MidSelfRating.RatingId = DataRow["MID_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating_ID"]));
ECR.MidSelfRating.Rate = DataRow["MID_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating"]));
ECR.MidAppr1Rating = new Rating();
ECR.MidAppr1Rating.RatingId = DataRow["MID_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating_ID"]));
ECR.MidAppr1Rating.Rate = DataRow["MID_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating"]));
//Final Year end comments & rating
ECR.FinalSelfComments = DataRow["Final_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_SELF_COMMENTS"]));
ECR.FinalSelfRating = new Rating();
ECR.FinalSelfRating.RatingId = DataRow["Final_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating_ID"]));
ECR.FinalSelfRating.Rate = DataRow["Final_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating"]));
ECR.FinalAppr1Rating = new Rating();
ECR.FinalAppr1Rating.RatingId = DataRow["Final_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating_ID"]));
ECR.FinalAppr1Rating.Rate = DataRow["Final_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating"]));
ECR.FinalAppr1Comments = DataRow["Final_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR1_COMMENTS"]));
ECR.FinalAppr2Rating = new Rating();
ECR.FinalAppr2Rating.RatingId = DataRow["Final_APPR2_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating_ID"]));
ECR.FinalAppr2Rating.Rate = DataRow["Final_APPR2_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating"]));
ECR.FinalAppr2Comments = DataRow["Final_APPR2_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR2_COMMENTS"]));
ECR.FinalAppr3Rating = new Rating();
ECR.FinalAppr3Rating.RatingId = DataRow["Final_APPR3_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating_ID"]));
ECR.FinalAppr3Rating.Rate = DataRow["Final_APPR3_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating"]));
ECR.FinalAppr3Comments = DataRow["Final_APPR3_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR3_COMMENTS"]));
ECR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ECR.BaseClass.Year = new AppraisalYear();
ECR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ECR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ECR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ECR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ECR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ECR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
EmpKRAList.Add(ECR);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
objcomp = new Component
{
BaseClass = new BaseClass(),
template = new TemplateMaster(),
CMId = DataRow["CM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CM_ID"])),
CmpCode = DataRow["Comp_Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Code"])),
CmpName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"])),
Description = DataRow["Comp_Desc"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Desc"])),
IsEmployeeVisible = DataRow["Is_EmployeeVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_EmployeeVisible"])),
IsManagerVisible = DataRow["Is_ManagerVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_ManagerVisible"])),
};
//objcomp.template.TMId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
objcomp.template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
objcomp.template.Name = DataRow["TempName"] is DBNull ? default(string) : Convert.ToString((DataRow["TempName"]));
objComplist.Add(objcomp);
}
}
}
else
{
Status.Success = true;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjKraMappingDetails.EmployeeComptencyReview = EmpKRAList;
ObjKraMappingDetails.Component = objComplist;
ObjKraMappingDetails.Status = Status;
if (ObjKraMappingDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeSectionReviwDetails
{
Status = ObjKraMappingDetails.Status,
EmployeeComptencyReview = ObjKraMappingDetails.EmployeeComptencyReview,
Component = ObjKraMappingDetails.Component,
});
}
public async Task<EmployeeSectionReviwDetails> GetEmployeePBODetails(Search Search)
{
Status Status = new Status();
EmployeeSectionReviwDetails ObjPBOMappingDetails = new EmployeeSectionReviwDetails();
List<EmployeeComptencyReview> objPBOReview = new List<EmployeeComptencyReview>();
EmployeeComptencyReview ECR = null;
List<Component> objComplist = new List<Component>();
Component objcomp = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpPBOReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ECR = new EmployeeComptencyReview
{
BaseClass = new BaseClass(),
Competency = new Competency(),
CompetencyType = new CompetencyType(),
CompetencyDetails = new CompetencyDetails(),
EmpReviewId = DataRow["EMP_REVIEW_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_REVIEW_ID"])),
};
ECR.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"]));
ECR.CompetencyType.ComptTypeDesc = DataRow["COMPT_TYPE"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE"]));
ECR.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"]));
ECR.Competency.ComptmId = DataRow["COMPTM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTM_ID"]));
ECR.Competency.ComptShortDesc = DataRow["COMPTM_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPTM_SHORT_DESC"]));
ECR.CompetencyDetails.ComptdId = DataRow["COMPTD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTD_ID"]));
ECR.CompetencyDetails.ComptdDesc = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
ECR.EmpComptDesc = DataRow["EMPCOMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["EMPCOMPT_DESC"]));
ECR.ComptTarget = DataRow["COMPT_TARGET"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TARGET"]));
ECR.ComptWeightage = DataRow["COMPT_WEIGHTAGE"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["COMPT_WEIGHTAGE"]));
//Self end comments & rating
ECR.SelfComments = DataRow["SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["SELF_COMMENTS"]));
ECR.Appr1Comments = DataRow["APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["APPR1_COMMENTS"]));
//Mid Year end comments & rating
ECR.MidSelfComments = DataRow["MID_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_SELF_COMMENTS"]));
ECR.MidAppr1Comments = DataRow["MID_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_APPR1_COMMENTS"]));
ECR.MidSelfRating = new Rating();
ECR.MidSelfRating.RatingId = DataRow["MID_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating_ID"]));
ECR.MidSelfRating.Rate = DataRow["MID_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating"]));
ECR.MidAppr1Rating = new Rating();
ECR.MidAppr1Rating.RatingId = DataRow["MID_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating_ID"]));
ECR.MidAppr1Rating.Rate = DataRow["MID_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating"]));
//Final Year end comments & rating
ECR.FinalSelfComments = DataRow["Final_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_SELF_COMMENTS"]));
ECR.FinalSelfRating = new Rating();
ECR.FinalSelfRating.RatingId = DataRow["Final_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating_ID"]));
ECR.FinalSelfRating.Rate = DataRow["Final_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating"]));
ECR.FinalAppr1Rating = new Rating();
ECR.FinalAppr1Rating.RatingId = DataRow["Final_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating_ID"]));
ECR.FinalAppr1Rating.Rate = DataRow["Final_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating"]));
ECR.FinalAppr1Comments = DataRow["Final_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR1_COMMENTS"]));
ECR.FinalAppr2Rating = new Rating();
ECR.FinalAppr2Rating.RatingId = DataRow["Final_APPR2_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating_ID"]));
ECR.FinalAppr2Rating.Rate = DataRow["Final_APPR2_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating"]));
ECR.FinalAppr2Comments = DataRow["Final_APPR2_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR2_COMMENTS"]));
ECR.FinalAppr3Rating = new Rating();
ECR.FinalAppr3Rating.RatingId = DataRow["Final_APPR3_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating_ID"]));
ECR.FinalAppr3Rating.Rate = DataRow["Final_APPR3_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating"]));
ECR.FinalAppr3Comments = DataRow["Final_APPR3_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR3_COMMENTS"]));
ECR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ECR.BaseClass.Year = new AppraisalYear();
ECR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ECR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ECR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ECR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ECR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ECR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
objPBOReview.Add(ECR);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
objcomp = new Component
{
BaseClass = new BaseClass(),
template = new TemplateMaster(),
CMId = DataRow["CM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CM_ID"])),
CmpCode = DataRow["Comp_Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Code"])),
CmpName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"])),
Description = DataRow["Comp_Desc"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Desc"])),
IsEmployeeVisible = DataRow["Is_EmployeeVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_EmployeeVisible"])),
IsManagerVisible = DataRow["Is_ManagerVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_ManagerVisible"])),
};
objcomp.template.TMId = DataRow["TM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TM_ID"]));
objcomp.template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
objcomp.template.Name = DataRow["TempName"] is DBNull ? default(string) : Convert.ToString((DataRow["TempName"]));
objComplist.Add(objcomp);
}
}
}
else
{
Status.Success = true;
Status.StateCode = 0;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjPBOMappingDetails.EmployeeComptencyReview = objPBOReview;
ObjPBOMappingDetails.Component = objComplist;
ObjPBOMappingDetails.Status = Status;
if (ObjPBOMappingDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeSectionReviwDetails
{
Status = ObjPBOMappingDetails.Status,
EmployeeComptencyReview = ObjPBOMappingDetails.EmployeeComptencyReview,
Component = ObjPBOMappingDetails.Component,
});
}
public async Task<EmployeeSectionReviwDetails> GetEmployeePFPDetails(Search Search)
{
Status Status = new Status();
EmployeeSectionReviwDetails ObjPBOMappingDetails = new EmployeeSectionReviwDetails();
List<EmployeeComptencyReview> objPBOReview = new List<EmployeeComptencyReview>();
EmployeeComptencyReview ECR = null;
List<Component> objComplist = new List<Component>();
Component objcomp = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpPFPReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ECR = new EmployeeComptencyReview
{
BaseClass = new BaseClass(),
Competency = new Competency(),
CompetencyType = new CompetencyType(),
CompetencyDetails = new CompetencyDetails(),
EmpReviewId = DataRow["EMP_REVIEW_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_REVIEW_ID"])),
};
ECR.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"]));
ECR.CompetencyType.ComptTypeDesc = DataRow["COMPT_TYPE"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE"]));
ECR.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"]));
ECR.Competency.ComptmId = DataRow["COMPTM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTM_ID"]));
ECR.Competency.ComptShortDesc = DataRow["COMPTM_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPTM_SHORT_DESC"]));
ECR.CompetencyDetails.ComptdId = DataRow["COMPTD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTD_ID"]));
ECR.CompetencyDetails.ComptdDesc = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
ECR.EmpComptDesc = DataRow["EMPCOMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["EMPCOMPT_DESC"]));
ECR.ComptTarget = DataRow["COMPT_TARGET"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TARGET"]));
ECR.ComptWeightage = DataRow["COMPT_WEIGHTAGE"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["COMPT_WEIGHTAGE"]));
//Self end comments & rating
ECR.SelfComments = DataRow["SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["SELF_COMMENTS"]));
ECR.Appr1Comments = DataRow["APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["APPR1_COMMENTS"]));
//Mid Year end comments & rating
ECR.MidSelfComments = DataRow["MID_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_SELF_COMMENTS"]));
ECR.MidAppr1Comments = DataRow["MID_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_APPR1_COMMENTS"]));
ECR.MidSelfRating = new Rating();
ECR.MidSelfRating.RatingId = DataRow["MID_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating_ID"]));
ECR.MidSelfRating.Rate = DataRow["MID_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating"]));
ECR.MidAppr1Rating = new Rating();
ECR.MidAppr1Rating.RatingId = DataRow["MID_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating_ID"]));
ECR.MidAppr1Rating.Rate = DataRow["MID_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating"]));
//Final Year end comments & rating
ECR.FinalSelfComments = DataRow["Final_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_SELF_COMMENTS"]));
ECR.FinalSelfRating = new Rating();
ECR.FinalSelfRating.RatingId = DataRow["Final_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating_ID"]));
ECR.FinalSelfRating.Rate = DataRow["Final_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating"]));
ECR.FinalAppr1Rating = new Rating();
ECR.FinalAppr1Rating.RatingId = DataRow["Final_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating_ID"]));
ECR.FinalAppr1Rating.Rate = DataRow["Final_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating"]));
ECR.FinalAppr1Comments = DataRow["Final_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR1_COMMENTS"]));
ECR.FinalAppr2Rating = new Rating();
ECR.FinalAppr2Rating.RatingId = DataRow["Final_APPR2_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating_ID"]));
ECR.FinalAppr2Rating.Rate = DataRow["Final_APPR2_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating"]));
ECR.FinalAppr2Comments = DataRow["Final_APPR2_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR2_COMMENTS"]));
ECR.FinalAppr3Rating = new Rating();
ECR.FinalAppr3Rating.RatingId = DataRow["Final_APPR3_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating_ID"]));
ECR.FinalAppr3Rating.Rate = DataRow["Final_APPR3_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating"]));
ECR.FinalAppr3Comments = DataRow["Final_APPR3_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR3_COMMENTS"]));
ECR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ECR.BaseClass.Year = new AppraisalYear();
ECR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ECR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ECR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ECR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ECR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ECR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
objPBOReview.Add(ECR);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
objcomp = new Component
{
BaseClass = new BaseClass(),
template = new TemplateMaster(),
CMId = DataRow["CM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CM_ID"])),
CmpCode = DataRow["Comp_Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Code"])),
CmpName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"])),
Description = DataRow["Comp_Desc"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Desc"])),
IsEmployeeVisible = DataRow["Is_EmployeeVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_EmployeeVisible"])),
IsManagerVisible = DataRow["Is_ManagerVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_ManagerVisible"])),
};
objcomp.template.TMId = DataRow["TM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TM_ID"]));
objcomp.template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
objcomp.template.Name = DataRow["TempName"] is DBNull ? default(string) : Convert.ToString((DataRow["TempName"]));
objComplist.Add(objcomp);
}
}
}
else
{
Status.Success = true;
Status.StateCode = 0;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjPBOMappingDetails.EmployeeComptencyReview = objPBOReview;
ObjPBOMappingDetails.Component = objComplist;
ObjPBOMappingDetails.Status = Status;
if (ObjPBOMappingDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeSectionReviwDetails
{
Status = ObjPBOMappingDetails.Status,
EmployeeComptencyReview = ObjPBOMappingDetails.EmployeeComptencyReview,
Component = ObjPBOMappingDetails.Component,
});
}
public async Task<EmployeeSectionReviwDetails> GetEmployeeCVBDetails(Search Search)
{
Status Status = new Status();
EmployeeSectionReviwDetails objEmpCVOReviewList = new EmployeeSectionReviwDetails();
List<EmployeeComptencyReview> objEmpCVBList = new List<EmployeeComptencyReview>();
EmployeeComptencyReview ECR = null;
List<Component> objComplist = new List<Component>();
Component objcomp = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpCVBReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ECR = new EmployeeComptencyReview
{
BaseClass = new BaseClass(),
Competency = new Competency(),
CompetencyType = new CompetencyType(),
CompetencyDetails = new CompetencyDetails(),
EmpReviewId = DataRow["EMP_REVIEW_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_REVIEW_ID"])),
};
ECR.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"]));
ECR.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"]));
ECR.Competency.ComptmId = DataRow["COMPTM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTM_ID"]));
ECR.Competency.ComptShortDesc = DataRow["COMPTM_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPTM_SHORT_DESC"]));
ECR.CompetencyDetails.ComptdId = DataRow["COMPTD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTD_ID"]));
ECR.CompetencyDetails.ComptdDesc = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
ECR.EmpComptDesc = DataRow["EMPCOMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["EMPCOMPT_DESC"]));
ECR.ComptTarget = DataRow["COMPT_TARGET"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TARGET"]));
ECR.ComptWeightage = DataRow["COMPT_WEIGHTAGE"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["COMPT_WEIGHTAGE"]));
//Self end comments & rating
ECR.SelfComments = DataRow["SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["SELF_COMMENTS"]));
ECR.Appr1Comments = DataRow["APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["APPR1_COMMENTS"]));
//Mid Year end comments & rating
ECR.MidSelfComments = DataRow["MID_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_SELF_COMMENTS"]));
ECR.MidAppr1Comments = DataRow["MID_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_APPR1_COMMENTS"]));
ECR.MidSelfRating = new Rating();
ECR.MidSelfRating.RatingId = DataRow["MID_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating_ID"]));
ECR.MidSelfRating.Rate = DataRow["MID_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating"]));
ECR.MidAppr1Rating = new Rating();
ECR.MidAppr1Rating.RatingId = DataRow["MID_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating_ID"]));
ECR.MidAppr1Rating.Rate = DataRow["MID_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating"]));
//Final Year end comments & rating
ECR.FinalSelfComments = DataRow["Final_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_SELF_COMMENTS"]));
ECR.FinalSelfRating = new Rating();
ECR.FinalSelfRating.RatingId = DataRow["Final_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating_ID"]));
ECR.FinalSelfRating.Rate = DataRow["Final_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating"]));
ECR.FinalAppr1Rating = new Rating();
ECR.FinalAppr1Rating.RatingId = DataRow["Final_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating_ID"]));
ECR.FinalAppr1Rating.Rate = DataRow["Final_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating"]));
ECR.FinalAppr1Comments = DataRow["Final_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR1_COMMENTS"]));
ECR.FinalAppr2Rating = new Rating();
ECR.FinalAppr2Rating.RatingId = DataRow["Final_APPR2_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating_ID"]));
ECR.FinalAppr2Rating.Rate = DataRow["Final_APPR2_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating"]));
ECR.FinalAppr2Comments = DataRow["Final_APPR2_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR2_COMMENTS"]));
ECR.FinalAppr3Rating = new Rating();
ECR.FinalAppr3Rating.RatingId = DataRow["Final_APPR3_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating_ID"]));
ECR.FinalAppr3Rating.Rate = DataRow["Final_APPR3_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating"]));
ECR.FinalAppr3Comments = DataRow["Final_APPR3_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR3_COMMENTS"]));
ECR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ECR.BaseClass.Year = new AppraisalYear();
ECR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ECR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ECR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ECR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ECR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ECR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
objEmpCVBList.Add(ECR);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
objcomp = new Component
{
BaseClass = new BaseClass(),
template = new TemplateMaster(),
CMId = DataRow["CM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CM_ID"])),
CmpCode = DataRow["Comp_Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Code"])),
CmpName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"])),
Description = DataRow["Comp_Desc"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Desc"])),
IsEmployeeVisible = DataRow["Is_EmployeeVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_EmployeeVisible"])),
IsManagerVisible = DataRow["Is_ManagerVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_ManagerVisible"])),
};
objcomp.template.TMId = DataRow["TM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TM_ID"]));
objcomp.template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
objcomp.template.Name = DataRow["TempName"] is DBNull ? default(string) : Convert.ToString((DataRow["TempName"]));
objComplist.Add(objcomp);
}
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
objEmpCVOReviewList.EmployeeComptencyReview = objEmpCVBList;
objEmpCVOReviewList.Component = objComplist;
objEmpCVOReviewList.Status = Status;
if (objEmpCVOReviewList == null)
{
return null;
}
return await Task.Run(() => new EmployeeSectionReviwDetails
{
Status = objEmpCVOReviewList.Status,
EmployeeComptencyReview = objEmpCVOReviewList.EmployeeComptencyReview,
Component = objEmpCVOReviewList.Component,
});
}
public async Task<EmployeeRatingDetails> GetEmployeeRatingDetails(Search Search)
{
Status Status = new Status();
EmployeeRatingDetails objEmpRatingDetails = new EmployeeRatingDetails();
List<EmployeeRating> objEmpRatinglist = new List<EmployeeRating>();
EmployeeRating ERD = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpRatingReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ERD = new EmployeeRating
{
BaseClass = new BaseClass(),
emp = new Employee(),
ApproversName = "",
Rating = new Rating(),
GoalStatus = new KRAStatus(),
MIDStatus = new KRAStatus(),
ENDStatus = new KRAStatus(),
EmpRatDetId = DataRow["Emp_Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Rating_Id"])),
ApproversId = DataRow["App_Seq"] is DBNull ? default(int) : Convert.ToInt32((DataRow["App_Seq"])),
AchievementComments = DataRow["AchievementComments"] is DBNull ? default(string) : Convert.ToString((DataRow["AchievementComments"])),
CareerDevelopmentComments = DataRow["CareerDevelopmentComments"] is DBNull ? default(string) : Convert.ToString((DataRow["CareerDevelopmentComments"])),
BackUpEmp = DataRow["BackUpEmp"] is DBNull ? default(string) : Convert.ToString((DataRow["BackUpEmp"])),
};
ERD.emp.EmpId = DataRow["Emp_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Id"]));
ERD.Rating.RatingId = DataRow["FinalRating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["FinalRating_Id"]));
ERD.Rating.RatingGrade = DataRow["RatingGrade"] is DBNull ? default(string) : Convert.ToString((DataRow["RatingGrade"]));
ERD.Rating.RatingDesc = DataRow["RatingDesc"] is DBNull ? default(string) : Convert.ToString((DataRow["RatingDesc"]));
ERD.GoalStatus.KraStatusId = DataRow["SetupStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["SetupStatus_Id"]));
ERD.GoalStatus.KraStatus = DataRow["GoalStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["GoalStatus_Name"]));
ERD.GoalStatus.SelfVisable = DataRow["Goal_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Goal_Self_Visable"]));
ERD.GoalStatus.ApproverVisable = DataRow["Goal_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Goal_Approver_Visable"]));
ERD.MIDStatus.KraStatusId = DataRow["MIDYearStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MIDYearStatus_Id"]));
ERD.MIDStatus.KraStatus = DataRow["MIDStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["MIDStatus_Name"]));
ERD.MIDStatus.SelfVisable = DataRow["MID_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_Self_Visable"]));
ERD.MIDStatus.ApproverVisable = DataRow["MID_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_Approver_Visable"]));
ERD.ENDStatus.KraStatusId = DataRow["ENDYearStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["ENDYearStatus_Id"]));
ERD.ENDStatus.KraStatus = DataRow["ENDStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["ENDStatus_Name"]));
ERD.ENDStatus.SelfVisable = DataRow["END_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["END_Self_Visable"]));
ERD.ENDStatus.ApproverVisable = DataRow["END_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["END_Approver_Visable"]));
ERD.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ERD.BaseClass.Year = new AppraisalYear();
ERD.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ERD.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ERD.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ERD.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ERD.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ERD.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
objEmpRatinglist.Add(ERD);
}
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
objEmpRatingDetails.EmployeeRating = objEmpRatinglist;
objEmpRatingDetails.Status = Status;
if (objEmpRatingDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeRatingDetails
{
Status = objEmpRatingDetails.Status,
EmployeeRating = objEmpRatingDetails.EmployeeRating,
});
}
public async Task<TrainingDetails> GetEmployeeTrainingDetails(Search Search)
{
Status Status = new Status();
TrainingDetails objTrainingDetails = new TrainingDetails();
List<Training> objTraining = new List<Training>();
Training ET = null;
List<Component> objComplist = new List<Component>();
Component objcomp = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpTrainingReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ET = new Training
{
baseClass = new BaseClass(),
emp = new Employee(),
SubCategory = new TrainingSubCategory(),
TDID = DataRow["TD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TD_ID"])),
ETDID = DataRow["ETD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["ETD_ID"])),
Description = DataRow["TrainingDetails"] is DBNull ? default(string) : Convert.ToString((DataRow["TrainingDetails"])),
Duration = DataRow["Duration"] is DBNull ? default(string) : Convert.ToString((DataRow["Duration"])),
Mode = DataRow["Mode"] is DBNull ? default(string) : Convert.ToString((DataRow["Mode"])),
TrainingName = DataRow["TrainingName"] is DBNull ? default(string) : Convert.ToString((DataRow["TrainingName"])),
EndDate = DataRow["EndDate"] is DBNull ? default(DateTime) : Convert.ToDateTime((DataRow["EndDate"])),
StartDate = DataRow["StartDate"] is DBNull ? default(DateTime) : Convert.ToDateTime((DataRow["StartDate"])),
RejectdBy = DataRow["RejectdBy"] is DBNull ? default(string) : Convert.ToString((DataRow["RejectdBy"])),
RejectedReason = DataRow["RejectedReason"] is DBNull ? default(string) : Convert.ToString((DataRow["RejectedReason"])),
};
ET.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
ET.SubCategory.TSCID = DataRow["TSC_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TSC_ID"]));
ET.SubCategory.SubCatName = DataRow["SubCatName"] is DBNull ? default(string) : Convert.ToString((DataRow["SubCatName"]));
ET.SubCategory.TrainingCategory = new TrainingCategory();
ET.SubCategory.TrainingCategory.TCID = DataRow["TC_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TC_ID"]));
ET.SubCategory.TrainingCategory.CatName = DataRow["CatName"] is DBNull ? default(string) : Convert.ToString((DataRow["CatName"]));
ET.baseClass.StatusId = DataRow["STATUS_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["STATUS_ID"]));
objTraining.Add(ET);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
objcomp = new Component
{
BaseClass = new BaseClass(),
template =new TemplateMaster(),
CMId = DataRow["CM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CM_ID"])),
CmpCode = DataRow["Comp_Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Code"])),
CmpName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"])),
Description = DataRow["Comp_Desc"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Desc"])),
IsEmployeeVisible = DataRow["Is_EmployeeVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_EmployeeVisible"])),
IsManagerVisible = DataRow["Is_ManagerVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_ManagerVisible"])),
};
objcomp.template.TMId = DataRow["TM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TM_ID"]));
objcomp.template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
objcomp.template.Name = DataRow["TempName"] is DBNull ? default(string) : Convert.ToString((DataRow["TempName"]));
objComplist.Add(objcomp);
}
}
}
else
{
Status.Success = true;
Status.StateCode = 0;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
objTrainingDetails.Training = objTraining;
objTrainingDetails.Status = Status;
objTrainingDetails.Component = objComplist;
if (objTrainingDetails == null)
{
return null;
}
return await Task.Run(() => new TrainingDetails
{
Status = objTrainingDetails.Status,
Training = objTrainingDetails.Training,
Component = objTrainingDetails.Component,
});
}
public async Task<SupportingDataDetails> GetEmployeeSupportingDataDetails(Search Search)
{
Status Status = new Status();
SupportingDataDetails objSupportingDataDetails = new SupportingDataDetails();
List<SupportingData> objSupportingDatalist = new List<SupportingData>();
SupportingData objSD = null;
List<Component> objComplist = new List<Component>();
Component objcomp = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpSupportingDataReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
objSD = new SupportingData
{
BaseClass = new BaseClass(),
Emp = new Employee(),
Achievements = DataRow["Achievements"] is DBNull ? default(string) : Convert.ToString((DataRow["Achievements"])),
ActionPlan = DataRow["Action_Plan"] is DBNull ? default(string) : Convert.ToString((DataRow["Action_Plan"])),
ChallengesFaced = DataRow["Challenges_Faced"] is DBNull ? default(string) : Convert.ToString((DataRow["Challenges_Faced"])),
CommentsEmployee = DataRow["Comments_Employee"] is DBNull ? default(string) : Convert.ToString((DataRow["Comments_Employee"])),
Targets = DataRow["Targets"] is DBNull ? default(string) : Convert.ToString((DataRow["Targets"])),
ESDId = DataRow["ESD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["ESD_ID"])),
};
objSD.Emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
//objSD.Emp.EmpUserId = DataRow["COMPT_TYPE"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE"]));
objSD.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
objSD.BaseClass.Year = new AppraisalYear();
objSD.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
objSD.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
objSD.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
objSD.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
objSD.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
objSD.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
objSupportingDatalist.Add(objSD);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
objcomp = new Component
{
BaseClass = new BaseClass(),
template = new TemplateMaster(),
CMId = DataRow["CM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CM_ID"])),
CmpCode = DataRow["Comp_Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Code"])),
CmpName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"])),
Description = DataRow["Comp_Desc"] is DBNull ? default(string) : Convert.ToString((DataRow["Comp_Desc"])),
IsEmployeeVisible = DataRow["Is_EmployeeVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_EmployeeVisible"])),
IsManagerVisible = DataRow["Is_ManagerVisible"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Is_ManagerVisible"])),
};
objcomp.template.TMId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
objcomp.template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
objcomp.template.Name = DataRow["TempName"] is DBNull ? default(string) : Convert.ToString((DataRow["TempName"]));
objComplist.Add(objcomp);
}
}
}
else
{
Status.Success = true;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
objSupportingDataDetails.SupportingData = objSupportingDatalist;
objSupportingDataDetails.Components = objComplist;
objSupportingDataDetails.Status = Status;
if (objSupportingDataDetails == null)
{
return null;
}
return await Task.Run(() => new SupportingDataDetails
{
Status = objSupportingDataDetails.Status,
SupportingData = objSupportingDataDetails.SupportingData,
Components= objSupportingDataDetails.Components,
});
}
public async Task<RemarksDetails> GetEmployeeRemarksDetails(Search Search)
{
Status Status = new Status();
RemarksDetails objRemarksDetails = new RemarksDetails();
List<Remarks> objRemarkslist = new List<Remarks>();
Remarks RM = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpReviewRemarksDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
RM = new Remarks
{
BaseClass = new BaseClass(),
emp = new Employee(),
rating = new Rating(),
EmpPotentail = new CommonType(),
RiskofLoss = new CommonType(),
RemarkId = DataRow["EMPRemark_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMPRemark_ID"])),
Remark = DataRow["Remarks"] is DBNull ? default(string) : Convert.ToString((DataRow["Remarks"])),
TotalValue = DataRow["TotalValue"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TotalValue"])),
IsPromotion = DataRow["Ispromotion"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Ispromotion"])),
PromotionRemarks = DataRow["PromotionRemarks"] is DBNull ? default(string) : Convert.ToString((DataRow["PromotionRemarks"])),
AppverID = DataRow["Approver_EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Approver_EMP_ID"])),
EmpType = DataRow["EmpType"] is DBNull ? default(string) : Convert.ToString((DataRow["EmpType"])),
IsVehicleRecomd = DataRow["IsVehicleRecomd"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IsVehicleRecomd"]))
};
RM.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
RM.rating.RatingId = DataRow["Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Rating_Id"]));
RM.BaseClass.StatusId = DataRow["STATUS_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["STATUS_ID"]));
RM.EmpPotentail.CId = DataRow["EPCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EPCID"]));
RM.RiskofLoss.CId = DataRow["RLCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["RLCID"]));
RM.EmpPotentail.Name = DataRow["EPCode"] is DBNull ? default(string) : Convert.ToString((DataRow["EPCode"]));
RM.RiskofLoss.Name = DataRow["RLCode"] is DBNull ? default(string) : Convert.ToString((DataRow["RLCode"]));
objRemarkslist.Add(RM);
}
}
}
else
{
Status.Success = true;
Status.StateCode = 0;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
objRemarksDetails.Remarks = objRemarkslist;
objRemarksDetails.Status = Status;
if (objRemarksDetails == null)
{
return null;
}
return await Task.Run(() => new RemarksDetails
{
Status = objRemarksDetails.Status,
Remarks = objRemarksDetails.Remarks,
});
}
#endregion
public async Task<EmployeeComptencyReviewDetails> GetEmployeeComptencyReviewDetails(Search Search)
{
Status Status = new Status();
EmployeeComptencyReviewDetails ObjKraMappingDetails = new EmployeeComptencyReviewDetails();
List<EmployeeComptencyReview> EmployeeComptencyReviewList = new List<EmployeeComptencyReview>();
EmployeeComptencyReview ECR = null;
List<EmployeeRating> EmployeeRatingDetailslist = new List<EmployeeRating>();
EmployeeRating ERD = null;
EmployeeIDPDetails objIDPDetails = new EmployeeIDPDetails();
List<EmployeeQuestions> objEmpQuestionsDetails = new List<EmployeeQuestions>();
EmployeeQuestions EOD = null;
List<DevelopmentPlan> objDevePlanDetails = new List<DevelopmentPlan>();
DevelopmentPlan DP = null;
List<DevelopmentTarget> objDevelopmentTarget = new List<DevelopmentTarget>();
DevelopmentTarget DT = null;
List<CompetencyType> objCompt = new List<CompetencyType>();
CompetencyType CP = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@ProcCode", Search.ProcCode),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_EmpComptencyReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ECR = new EmployeeComptencyReview
{
BaseClass = new BaseClass(),
Competency = new Competency(),
CompetencyType = new CompetencyType(),
CompetencyDetails = new CompetencyDetails(),
EmpReviewId = DataRow["EMP_REVIEW_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_REVIEW_ID"])),
};
ECR.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"]));
ECR.CompetencyType.ComptTypeDesc = DataRow["COMPT_TYPE"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE"]));
ECR.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"]));
ECR.Competency.ComptmId = DataRow["COMPTM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTM_ID"]));
ECR.Competency.ComptShortDesc = DataRow["COMPTM_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPTM_SHORT_DESC"]));
ECR.CompetencyDetails.ComptdId = DataRow["COMPTD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTD_ID"]));
ECR.CompetencyDetails.ComptdDesc = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
ECR.EmpComptDesc = DataRow["EMPCOMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["EMPCOMPT_DESC"]));
ECR.ComptTarget = DataRow["COMPT_TARGET"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TARGET"]));
ECR.ComptWeightage = DataRow["COMPT_WEIGHTAGE"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["COMPT_WEIGHTAGE"]));
//Self end comments & rating
ECR.SelfComments = DataRow["SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["SELF_COMMENTS"]));
ECR.Appr1Comments = DataRow["APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["APPR1_COMMENTS"]));
//Mid Year end comments & rating
ECR.MidSelfComments = DataRow["MID_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_SELF_COMMENTS"]));
ECR.MidAppr1Comments = DataRow["MID_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_APPR1_COMMENTS"]));
ECR.MidSelfRating = new Rating();
ECR.MidSelfRating.RatingId = DataRow["MID_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating_ID"]));
ECR.MidSelfRating.Rate = DataRow["MID_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating"]));
ECR.MidAppr1Rating = new Rating();
ECR.MidAppr1Rating.RatingId = DataRow["MID_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating_ID"]));
ECR.MidAppr1Rating.Rate = DataRow["MID_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating"]));
//Final Year end comments & rating
ECR.FinalSelfComments = DataRow["Final_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_SELF_COMMENTS"]));
ECR.FinalSelfRating = new Rating();
ECR.FinalSelfRating.RatingId = DataRow["Final_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating_ID"]));
ECR.FinalSelfRating.Rate = DataRow["Final_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating"]));
ECR.FinalAppr1Rating = new Rating();
ECR.FinalAppr1Rating.RatingId = DataRow["Final_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating_ID"]));
ECR.FinalAppr1Rating.Rate = DataRow["Final_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating"]));
ECR.FinalAppr1Comments = DataRow["Final_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR1_COMMENTS"]));
ECR.FinalAppr2Rating = new Rating();
ECR.FinalAppr2Rating.RatingId = DataRow["Final_APPR2_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating_ID"]));
ECR.FinalAppr2Rating.Rate = DataRow["Final_APPR2_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating"]));
ECR.FinalAppr2Comments = DataRow["Final_APPR2_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR2_COMMENTS"]));
ECR.FinalAppr3Rating = new Rating();
ECR.FinalAppr3Rating.RatingId = DataRow["Final_APPR3_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating_ID"]));
ECR.FinalAppr3Rating.Rate = DataRow["Final_APPR3_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating"]));
ECR.FinalAppr3Comments = DataRow["Final_APPR3_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR3_COMMENTS"]));
ECR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ECR.BaseClass.Year = new AppraisalYear();
ECR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ECR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ECR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ECR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ECR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ECR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
EmployeeComptencyReviewList.Add(ECR);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
ERD = new EmployeeRating
{
BaseClass = new BaseClass(),
emp = new Employee(),
ApproversName = "",
Rating = new Rating(),
GoalStatus = new KRAStatus(),
MIDStatus = new KRAStatus(),
ENDStatus = new KRAStatus(),
EmpRatDetId = DataRow["Emp_Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Rating_Id"])),
ApproversId = DataRow["App_Seq"] is DBNull ? default(int) : Convert.ToInt32((DataRow["App_Seq"])),
};
ERD.emp.EmpId = DataRow["Emp_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Id"]));
ERD.Rating.RatingId = DataRow["FinalRating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["FinalRating_Id"]));
ERD.Rating.RatingGrade = DataRow["RatingGrade"] is DBNull ? default(string) : Convert.ToString((DataRow["RatingGrade"]));
ERD.Rating.RatingDesc = DataRow["RatingDesc"] is DBNull ? default(string) : Convert.ToString((DataRow["RatingDesc"]));
ERD.GoalStatus.KraStatusId = DataRow["SetupStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["SetupStatus_Id"]));
ERD.GoalStatus.KraStatus = DataRow["GoalStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["GoalStatus_Name"]));
ERD.GoalStatus.SelfVisable = DataRow["Goal_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Goal_Self_Visable"]));
ERD.GoalStatus.ApproverVisable = DataRow["Goal_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Goal_Approver_Visable"]));
ERD.MIDStatus.KraStatusId = DataRow["MIDYearStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MIDYearStatus_Id"]));
ERD.MIDStatus.KraStatus = DataRow["MIDStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["MIDStatus_Name"]));
ERD.MIDStatus.SelfVisable = DataRow["MID_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_Self_Visable"]));
ERD.MIDStatus.ApproverVisable = DataRow["MID_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_Approver_Visable"]));
ERD.ENDStatus.KraStatusId = DataRow["ENDYearStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["ENDYearStatus_Id"]));
ERD.ENDStatus.KraStatus = DataRow["ENDStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["ENDStatus_Name"]));
ERD.ENDStatus.SelfVisable = DataRow["END_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["END_Self_Visable"]));
ERD.ENDStatus.ApproverVisable = DataRow["END_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["END_Approver_Visable"]));
ERD.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ERD.BaseClass.Year = new AppraisalYear();
ERD.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ERD.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ERD.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ERD.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ERD.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ERD.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
EmployeeRatingDetailslist.Add(ERD);
}
}
if (ds.Tables[2].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[2].Rows)
{
EOD = new EmployeeQuestions
{
baseClass = new BaseClass(),
ques = new Questions(),
emp = new Employee(),
mgremp = new Employee(),
EMPQTID = DataRow["EMP_QT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_QT_ID"])),
EmpComments = DataRow["Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Emp_Comments"])),
MgrComments = DataRow["Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mgr_Comments"])),
MidEmpComments = DataRow["Mid_Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Emp_Comments"])),
MidMgrComments = DataRow["Mid_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Mgr_Comments"])),
FinalEmpComments = DataRow["Final_Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Emp_Comments"])),
FinalMgrComments = DataRow["Final_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Mgr_Comments"])),
};
EOD.ques.QTID = DataRow["QT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["QT_ID"]));
EOD.ques.Desc = DataRow["QT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["QT_DESC"]));
EOD.ques.IDP = new IDP();
EOD.ques.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
EOD.ques.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
EOD.ques.IDP.Category = new Category();
EOD.ques.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
EOD.ques.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
EOD.ques.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
EOD.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
// EOD.emp.EmpName = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
objEmpQuestionsDetails.Add(EOD);
}
}
if (ds.Tables[3].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[3].Rows)
{
DT = new DevelopmentTarget
{
baseClass = new BaseClass(),
emp = new Employee(),
Mgremp = new Employee(),
IDP = new IDP(),
AssignmentRole = DataRow["Assignment_Role"] is DBNull ? default(string) : Convert.ToString((DataRow["Assignment_Role"])),
EMPDTID = DataRow["EMP_DT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_DT_ID"])),
Objective = DataRow["Objective"] is DBNull ? default(string) : Convert.ToString((DataRow["Objective"])),
Timing = DataRow["Timing"] is DBNull ? default(string) : Convert.ToString((DataRow["Timing"])),
SpecificsNotes = DataRow["Specifics_Notes"] is DBNull ? default(string) : Convert.ToString((DataRow["Specifics_Notes"])),
MidNotes = DataRow["MidNotes"] is DBNull ? default(string) : Convert.ToString((DataRow["MidNotes"])),
};
DT.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
DT.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
DT.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
DT.IDP.Category = new Category();
DT.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
DT.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
DT.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
objDevelopmentTarget.Add(DT);
}
}
if (ds.Tables[4].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[4].Rows)
{
DP = new DevelopmentPlan
{
baseClass = new BaseClass(),
emp = new Employee(),
Mgremp = new Employee(),
IDP = new IDP(),
DevelopmentAchieved = DataRow["Development_Achieved"] is DBNull ? default(string) : Convert.ToString((DataRow["Development_Achieved"])),
EMPDAPID = DataRow["EMP_DAP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_DAP_ID"])),
TobeComplete = DataRow["Tobe_Complete"] is DBNull ? default(string) : Convert.ToString((DataRow["Tobe_Complete"])),
Timing = DataRow["Timing"] is DBNull ? default(string) : Convert.ToString((DataRow["Timing"])),
Status = DataRow["Status"] is DBNull ? default(string) : Convert.ToString((DataRow["Status"])),
Mgr_Status = DataRow["Mgr_Status"] is DBNull ? default(string) : Convert.ToString((DataRow["Mgr_Status"])),
MidtermStatus = DataRow["MidtermStatus"] is DBNull ? default(string) : Convert.ToString((DataRow["MidtermStatus"])),
FinalStatus = DataRow["FinalStatus"] is DBNull ? default(string) : Convert.ToString((DataRow["FinalStatus"])),
MidMgrComments = DataRow["Mid_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Mgr_Comments"])),
FinalMgrComments = DataRow["Final_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Mgr_Comments"])),
};
DP.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
DP.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
DP.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
DP.IDP.Category = new Category();
DP.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
DP.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
DP.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
objDevePlanDetails.Add(DP);
}
}
if (ds.Tables[5].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[5].Rows)
{
CP = new CompetencyType
{
BaseClass = new BaseClass(),
Template = new TemplateMaster(),
ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"])),
ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"])),
ComptTypeDesc = DataRow["COMPT_TYPE_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_DESC"])),
Weightage = DataRow["WEIGHTAGE"] is DBNull ? default(int) : Convert.ToInt32((DataRow["WEIGHTAGE"])),
ComptTypeSeq = DataRow["OrderBy"] is DBNull ? default(int) : Convert.ToInt32((DataRow["OrderBy"])),
};
CP.BaseClass.StatusId = DataRow["STATUS_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["STATUS_ID"]));
CP.BaseClass.StatusId = DataRow["STATUS_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["STATUS_ID"]));
CP.Template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
CP.Template.TMId = DataRow["TM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TM_ID"]));
objCompt.Add(CP);
}
}
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjKraMappingDetails.EmployeeComptencyReview = EmployeeComptencyReviewList;
ObjKraMappingDetails.EmployeeRatingDetails = EmployeeRatingDetailslist;
ObjKraMappingDetails.DevelopmentTarget = objDevelopmentTarget;
ObjKraMappingDetails.DevelopmentPlan = objDevePlanDetails;
ObjKraMappingDetails.EmployeeQuestions = objEmpQuestionsDetails;
ObjKraMappingDetails.Comptetency = objCompt;
ObjKraMappingDetails.Status = Status;
if (ObjKraMappingDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeComptencyReviewDetails
{
Status = ObjKraMappingDetails.Status,
EmployeeComptencyReview = ObjKraMappingDetails.EmployeeComptencyReview,
EmployeeRatingDetails = ObjKraMappingDetails.EmployeeRatingDetails,
DevelopmentPlan = ObjKraMappingDetails.DevelopmentPlan,
DevelopmentTarget = ObjKraMappingDetails.DevelopmentTarget,
EmployeeQuestions = ObjKraMappingDetails.EmployeeQuestions,
Comptetency = ObjKraMappingDetails.Comptetency,
});
}
public async Task<Status> SaveEmployeeComptencyReviewDetails(string Data, string EmpCode)
{
Status Status = new Status();
try
{
List<DbParameter> ParameterList = new List<DbParameter>();
ParameterList.Add(base.GetParameter("@JSONOUTPUT ", Data));
ParameterList.Add(base.GetParameter("@ActionBy", EmpCode));
ParameterList.Add(base.GetParameterOut("@ErrorCode", SqlDbType.Int, 4));
ParameterList.Add(base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, 255));
base.ExecuteNonQuery(SPName.InsertUpdate_EmpComptencyReviewDetails, ParameterList);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
Status.StateCode = 1;
//Status.Message = "Data has been saved Successfully.";
Status.Message = "3003";
}
else
{
Status.Success = false;
Status.StateCode = 0;
Status.Message = "5014";
}
}
catch (Exception Ex)
{
Status.Success = false;
Status.StateCode = 0;
// Status.Message = Ex.Message;
Status.Message = "5014";
}
return await Task.Run(() => new Status
{
Success = Status.Success,
Message = Status.Message,
StateCode = Status.StateCode
});
}
public async Task<EmployeePreviousMgrFeedbackDetails> GetEmployeePreviousMgrFeedback(Search Search)
{
Status Status = new Status();
EmployeePreviousMgrFeedbackDetails ObjFeedbackDetails = new EmployeePreviousMgrFeedbackDetails();
List<EmployeePreviousMgrFeedback> EmployeefeedbackList = new List<EmployeePreviousMgrFeedback>();
EmployeePreviousMgrFeedback EPMR = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@@YearId", Search.CompanyId),
base.GetParameter("@EMPId", Search.CompanyId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataTable Dt = base.ExecuteDataTable(SPName.Get_EmployeePreviousMgrFeedback, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
EPMR = new EmployeePreviousMgrFeedback
{
BaseClass = new BaseClass(),
FeedbackId = DataRow["KRAM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["KRAM_ID"])),
EmpId = DataRow["KRAM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["KRAM_ID"])),
ApproverEMPId = DataRow["KRAM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["KRAM_ID"])),
PeriodId = DataRow["KRAM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["KRAM_ID"])),
RatingId = DataRow["KRAM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["KRAM_ID"])),
Comments = DataRow["KRAM_ID"] is DBNull ? default(string) : Convert.ToString((DataRow["KRAM_ID"])),
};
EPMR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
EPMR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
EPMR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
EPMR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
EPMR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
EPMR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
EPMR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
EmployeefeedbackList.Add(EPMR);
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjFeedbackDetails.EmployeePreviousMgrFeedback = EmployeefeedbackList;
ObjFeedbackDetails.Status = Status;
if (ObjFeedbackDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeePreviousMgrFeedbackDetails
{
Status = ObjFeedbackDetails.Status,
EmployeePreviousMgrFeedback = ObjFeedbackDetails.EmployeePreviousMgrFeedback,
});
}
public async Task<CompetencyMappingDetails> GetEmployeeMappedCompetencyDetails(Search Search)
{
Status Status = new Status();
CompetencyMappingDetails ObjKraMappingDetails = new CompetencyMappingDetails();
List<CompetencyMapping> kraMappingList = new List<CompetencyMapping>();
CompetencyMapping KraMap = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EmpId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataTable Dt = base.ExecuteDataTable(SPName.GetEmployeeMappedKraDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
KraMap = new CompetencyMapping
{
BaseClass = new BaseClass(),
Competency = new Competency(),
CompetencyType = new CompetencyType(),
Department = new Department(),
Function = new Function(),
EmployeeType = new EmployeeType(),
CompetencyDetails = new CompetencyDetails(),
CMId = DataRow["CMAP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CMAP_ID"])),
};
KraMap.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"]));
KraMap.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"]));
KraMap.Competency.ComptmId = DataRow["COMPTM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTM_ID"]));
KraMap.Competency.ComptShortDesc = DataRow["COMPTM_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPTM_SHORT_DESC"]));
KraMap.CompetencyDetails.ComptdId = DataRow["COMPTD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTD_ID"]));
KraMap.CompetencyDetails.ComptdDesc = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
KraMap.Department.DeptId = DataRow["DEP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["DEP_ID"]));
KraMap.Department.DeptShortDesc = DataRow["DEPT_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["DEPT_Name"]));
KraMap.Function.FunId = DataRow["FUN_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["FUN_ID"]));
KraMap.Function.FunShortDesc = DataRow["FUN_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["FUN_DESC"]));
KraMap.EmployeeType.EmpTypeId = DataRow["EMP_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_TYPE_ID"]));
KraMap.EmployeeType.EmpTypeName = DataRow["EMP_TYPE_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_TYPE_DESC"]));
KraMap.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
KraMap.BaseClass.Year = new AppraisalYear();
KraMap.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
KraMap.BaseClass.Year.Year = DataRow["Year"] is DBNull ? default(string) : Convert.ToString(DataRow["Year"]);
KraMap.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
KraMap.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
KraMap.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
KraMap.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
KraMap.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
kraMappingList.Add(KraMap);
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjKraMappingDetails.CompetencyMapping = kraMappingList;
ObjKraMappingDetails.Status = Status;
if (ObjKraMappingDetails == null)
{
return null;
}
return await Task.Run(() => new CompetencyMappingDetails
{
Status = ObjKraMappingDetails.Status,
CompetencyMapping = ObjKraMappingDetails.CompetencyMapping,
});
}
public async Task<EmployeeComptencyReviewDetails> GetPendingEmployeeReviewDetails(Search Search)
{
Status Status = new Status();
EmployeeComptencyReviewDetails ObjKraMappingDetails = new EmployeeComptencyReviewDetails();
List<EmployeeRating> EmployeeRatingDetailslist = new List<EmployeeRating>();
EmployeeRating ERD = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@ProcessCode", Search.ProcCode),
base.GetParameter("@StatusId", Search.Status),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_PendingEmpReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ERD = new EmployeeRating
{
BaseClass = new BaseClass(),
emp = new Employee(),
ApproversName = "",
Rating = new Rating(),
GoalStatus = new KRAStatus(),
MIDStatus = new KRAStatus(),
ENDStatus = new KRAStatus(),
Process = new ProcessType(),
};
ERD.emp.EmpId = DataRow["Emp_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Id"]));
ERD.emp.EmpName = DataRow["EMP_NAME"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_NAME"]));
ERD.emp.EmpCode = DataRow["EMP_CODE"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_CODE"]));
ERD.emp.EmailId = DataRow["EMAIL_ID"] is DBNull ? default(string) : Convert.ToString((DataRow["EMAIL_ID"]));
ERD.Process.Code = DataRow["Processcode"] is DBNull ? default(string) : Convert.ToString((DataRow["Processcode"]));
ERD.Process.Description = DataRow["ProcessDescription"] is DBNull ? default(string) : Convert.ToString((DataRow["ProcessDescription"]));
ERD.GoalStatus.KraStatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Status_ID"]));
ERD.GoalStatus.KraStatus = DataRow["Status_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Status_Name"]));
ERD.GoalStatus.SelfVisable = DataRow["Self_Status_id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Self_Status_id"]));
ERD.GoalStatus.ApproverVisable = DataRow["Approver_statusId"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Approver_statusId"]));
//ERD.GoalStatus.SelfVisable = DataRow["isSelf_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["isSelf_Visable"]));
//ERD.GoalStatus.ApproverVisable = DataRow["isApprover_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["isApprover_Visable"]));
ERD.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ERD.BaseClass.Year = new AppraisalYear();
ERD.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ERD.BaseClass.Year.Year = DataRow["DisplayYear"] is DBNull ? default(string) : Convert.ToString(DataRow["DisplayYear"]);
EmployeeRatingDetailslist.Add(ERD);
}
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
// ObjKraMappingDetails.EmployeeComptencyReview = EmployeeComptencyReviewList;
ObjKraMappingDetails.EmployeeRatingDetails = EmployeeRatingDetailslist;
ObjKraMappingDetails.Status = Status;
if (ObjKraMappingDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeComptencyReviewDetails
{
Status = ObjKraMappingDetails.Status,
// EmployeeComptencyReview = ObjKraMappingDetails.EmployeeComptencyReview,
EmployeeRatingDetails = ObjKraMappingDetails.EmployeeRatingDetails,
});
}
public async Task<Status> SaveReferBackRequest(string Data, string EmpCode)
{
Status Status = new Status();
try
{
List<DbParameter> ParameterList = new List<DbParameter>();
ParameterList.Add(base.GetParameter("@JSONOUTPUT ", Data));
ParameterList.Add(base.GetParameter("@ActionBy", EmpCode));
ParameterList.Add(base.GetParameterOut("@ErrorCode", SqlDbType.Int, 4));
ParameterList.Add(base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, 255));
base.ExecuteNonQuery(SPName.InsertUpdate_ReferBackRequest, ParameterList);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
Status.StateCode = 1;
//Status.Message = "Data has been saved Successfully.";
Status.Message = "3003";
}
else
{
Status.Success = false;
Status.StateCode = 0;
Status.Message = "5014";
}
}
catch (Exception Ex)
{
Status.Success = false;
Status.StateCode = 0;
// Status.Message = Ex.Message;
Status.Message = "5014";
}
return await Task.Run(() => new Status
{
Success = Status.Success,
Message = Status.Message,
StateCode = Status.StateCode
});
}
public async Task<Status> GetPeriodSettingInfo(Search Search)
{
Status Status = new Status();
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@ProcessCode", Search.ProcCode),
base.GetParameter("@EMPType", Search.EmpType),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_PeriodSetting, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
//Status.Message = "3002";
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
return await Task.Run(() => new Status
{
Success = Status.Success,
Message = Status.Message,
StateCode = Status.StateCode
});
}
public async Task<ReferbackRequestDetails> GetReferbackDetails(Search Search)
{
Status Status = new Status();
ReferbackRequestDetails ObjreferbackDetails = new ReferbackRequestDetails();
List<ReferbackRequest> referbackList = new List<ReferbackRequest>();
ReferbackRequest refer = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@ProcessType", Search.ProcCode),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataTable Dt = base.ExecuteDataTable(SPName.Get_ReferBackRequest, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
refer = new ReferbackRequest
{
baseClass = new BaseClass(),
emp = new Employee(),
Referbackby = new Employee(),
Processtype = new ProcessType(),
RefId = DataRow["Ref_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Ref_Id"])),
Comments = DataRow["COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["COMMENTS"])),
};
refer.emp.EmpId = DataRow["EMP_Id"] is DBNull ? default(int) : Convert.ToInt32(DataRow["EMP_Id"]);
refer.Referbackby.EmpId = DataRow["Referback_by"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Referback_by"]);
refer.Processtype.Code = DataRow["Process_Type"] is DBNull ? default(string) : Convert.ToString(DataRow["Process_Type"]);
//refer.baseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
//refer.baseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
//refer.baseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
//refer.baseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
//refer.baseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
//refer.baseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
//refer.baseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
referbackList.Add(refer);
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjreferbackDetails.Referbacks = referbackList;
ObjreferbackDetails.Status = Status;
if (ObjreferbackDetails == null)
{
return null;
}
return await Task.Run(() => new ReferbackRequestDetails
{
Status = ObjreferbackDetails.Status,
Referbacks = ObjreferbackDetails.Referbacks,
});
}
public async Task<EmployeeComptencyReviewDetails> GetEmployeeEndYearReviewDetails(Search Search)
{
Status Status = new Status();
EmployeeComptencyReviewDetails ObjKraMappingDetails = new EmployeeComptencyReviewDetails();
List<EmployeeComptencyReview> EmployeeComptencyReviewList = new List<EmployeeComptencyReview>();
EmployeeComptencyReview ECR = null;
List<EmployeeComptencyReview> EmployeeCVOReviewList = new List<EmployeeComptencyReview>();
List<EmployeeRating> EmployeeRatingDetailslist = new List<EmployeeRating>();
EmployeeRating ERD = null;
EmployeeIDPDetails objIDPDetails = new EmployeeIDPDetails();
List<EmployeeQuestions> objEmpQuestionsDetails = new List<EmployeeQuestions>();
EmployeeQuestions EOD = null;
List<DevelopmentPlan> objDevePlanDetails = new List<DevelopmentPlan>();
DevelopmentPlan DP = null;
List<DevelopmentTarget> objDevelopmentTarget = new List<DevelopmentTarget>();
DevelopmentTarget DT = null;
List<Training> objTraining = new List<Training>();
Training ET = null;
List<Remarks> objRemarks = new List<Remarks>();
Remarks RM = null;
List<CompetencyType> objCompt = new List<CompetencyType>();
CompetencyType CP = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.GetEmployeeEndYearReviewDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ECR = new EmployeeComptencyReview
{
BaseClass = new BaseClass(),
Competency = new Competency(),
CompetencyType = new CompetencyType(),
CompetencyDetails = new CompetencyDetails(),
EmpReviewId = DataRow["EMP_REVIEW_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_REVIEW_ID"])),
};
ECR.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"]));
ECR.CompetencyType.ComptTypeDesc = DataRow["COMPT_TYPE"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE"]));
ECR.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"]));
ECR.Competency.ComptmId = DataRow["COMPTM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTM_ID"]));
ECR.Competency.ComptShortDesc = DataRow["COMPTM_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPTM_SHORT_DESC"]));
ECR.CompetencyDetails.ComptdId = DataRow["COMPTD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTD_ID"]));
ECR.CompetencyDetails.ComptdDesc = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
ECR.EmpComptDesc = DataRow["EMPCOMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["EMPCOMPT_DESC"]));
ECR.ComptTarget = DataRow["COMPT_TARGET"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TARGET"]));
ECR.ComptWeightage = DataRow["COMPT_WEIGHTAGE"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["COMPT_WEIGHTAGE"]));
//Self end comments & rating
ECR.SelfComments = DataRow["SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["SELF_COMMENTS"]));
ECR.Appr1Comments = DataRow["APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["APPR1_COMMENTS"]));
//Mid Year end comments & rating
ECR.MidSelfComments = DataRow["MID_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_SELF_COMMENTS"]));
ECR.MidAppr1Comments = DataRow["MID_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_APPR1_COMMENTS"]));
ECR.MidSelfRating = new Rating();
ECR.MidSelfRating.RatingId = DataRow["MID_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating_ID"]));
ECR.MidSelfRating.Rate = DataRow["MID_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating"]));
ECR.MidAppr1Rating = new Rating();
ECR.MidAppr1Rating.RatingId = DataRow["MID_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating_ID"]));
ECR.MidAppr1Rating.Rate = DataRow["MID_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating"]));
//Final Year end comments & rating
ECR.FinalSelfComments = DataRow["Final_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_SELF_COMMENTS"]));
ECR.FinalSelfRating = new Rating();
ECR.FinalSelfRating.RatingId = DataRow["Final_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating_ID"]));
ECR.FinalSelfRating.Rate = DataRow["Final_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating"]));
ECR.FinalAppr1Rating = new Rating();
ECR.FinalAppr1Rating.RatingId = DataRow["Final_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating_ID"]));
ECR.FinalAppr1Rating.Rate = DataRow["Final_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating"]));
ECR.FinalAppr1Comments = DataRow["Final_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR1_COMMENTS"]));
ECR.FinalAppr2Rating = new Rating();
ECR.FinalAppr2Rating.RatingId = DataRow["Final_APPR2_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating_ID"]));
ECR.FinalAppr2Rating.Rate = DataRow["Final_APPR2_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating"]));
ECR.FinalAppr2Comments = DataRow["Final_APPR2_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR2_COMMENTS"]));
ECR.FinalAppr3Rating = new Rating();
ECR.FinalAppr3Rating.RatingId = DataRow["Final_APPR3_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating_ID"]));
ECR.FinalAppr3Rating.Rate = DataRow["Final_APPR3_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating"]));
ECR.FinalAppr3Comments = DataRow["Final_APPR3_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR3_COMMENTS"]));
ECR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ECR.BaseClass.Year = new AppraisalYear();
ECR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ECR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ECR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ECR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ECR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ECR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
EmployeeComptencyReviewList.Add(ECR);
}
}
if (ds.Tables[1].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[1].Rows)
{
ERD = new EmployeeRating
{
BaseClass = new BaseClass(),
emp = new Employee(),
ApproversName = "",
Rating = new Rating(),
GoalStatus = new KRAStatus(),
MIDStatus = new KRAStatus(),
ENDStatus = new KRAStatus(),
EmpRatDetId = DataRow["Emp_Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Rating_Id"])),
ApproversId = DataRow["App_Seq"] is DBNull ? default(int) : Convert.ToInt32((DataRow["App_Seq"])),
AchievementComments = DataRow["AchievementComments"] is DBNull ? default(string) : Convert.ToString((DataRow["AchievementComments"])),
CareerDevelopmentComments = DataRow["CareerDevelopmentComments"] is DBNull ? default(string) : Convert.ToString((DataRow["CareerDevelopmentComments"])),
};
ERD.emp.EmpId = DataRow["Emp_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Id"]));
ERD.Rating.RatingId = DataRow["FinalRating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["FinalRating_Id"]));
ERD.Rating.RatingGrade = DataRow["RatingGrade"] is DBNull ? default(string) : Convert.ToString((DataRow["RatingGrade"]));
ERD.Rating.RatingDesc = DataRow["RatingDesc"] is DBNull ? default(string) : Convert.ToString((DataRow["RatingDesc"]));
ERD.GoalStatus.KraStatusId = DataRow["SetupStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["SetupStatus_Id"]));
ERD.GoalStatus.KraStatus = DataRow["GoalStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["GoalStatus_Name"]));
ERD.GoalStatus.SelfVisable = DataRow["Goal_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Goal_Self_Visable"]));
ERD.GoalStatus.ApproverVisable = DataRow["Goal_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Goal_Approver_Visable"]));
ERD.MIDStatus.KraStatusId = DataRow["MIDYearStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MIDYearStatus_Id"]));
ERD.MIDStatus.KraStatus = DataRow["MIDStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["MIDStatus_Name"]));
ERD.MIDStatus.SelfVisable = DataRow["MID_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_Self_Visable"]));
ERD.MIDStatus.ApproverVisable = DataRow["MID_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_Approver_Visable"]));
ERD.ENDStatus.KraStatusId = DataRow["ENDYearStatus_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["ENDYearStatus_Id"]));
ERD.ENDStatus.KraStatus = DataRow["ENDStatus_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["ENDStatus_Name"]));
ERD.ENDStatus.SelfVisable = DataRow["END_Self_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["END_Self_Visable"]));
ERD.ENDStatus.ApproverVisable = DataRow["END_Approver_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["END_Approver_Visable"]));
ERD.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ERD.BaseClass.Year = new AppraisalYear();
ERD.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ERD.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ERD.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ERD.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ERD.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ERD.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
EmployeeRatingDetailslist.Add(ERD);
}
}
if (ds.Tables[2].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[2].Rows)
{
ECR = new EmployeeComptencyReview
{
BaseClass = new BaseClass(),
Competency = new Competency(),
CompetencyType = new CompetencyType(),
CompetencyDetails = new CompetencyDetails(),
EmpReviewId = DataRow["EMP_REVIEW_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_REVIEW_ID"])),
};
ECR.CompetencyType.ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"]));
ECR.CompetencyType.ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"]));
ECR.Competency.ComptmId = DataRow["COMPTM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTM_ID"]));
ECR.Competency.ComptShortDesc = DataRow["COMPTM_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPTM_SHORT_DESC"]));
ECR.CompetencyDetails.ComptdId = DataRow["COMPTD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPTD_ID"]));
ECR.CompetencyDetails.ComptdDesc = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
ECR.EmpComptDesc = DataRow["EMPCOMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["EMPCOMPT_DESC"]));
ECR.ComptTarget = DataRow["COMPT_TARGET"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TARGET"]));
ECR.ComptWeightage = DataRow["COMPT_WEIGHTAGE"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["COMPT_WEIGHTAGE"]));
//Self end comments & rating
ECR.SelfComments = DataRow["SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["SELF_COMMENTS"]));
ECR.Appr1Comments = DataRow["APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["APPR1_COMMENTS"]));
//Mid Year end comments & rating
ECR.MidSelfComments = DataRow["MID_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_SELF_COMMENTS"]));
ECR.MidAppr1Comments = DataRow["MID_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["MID_APPR1_COMMENTS"]));
ECR.MidSelfRating = new Rating();
ECR.MidSelfRating.RatingId = DataRow["MID_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating_ID"]));
ECR.MidSelfRating.Rate = DataRow["MID_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_SELF_Rating"]));
ECR.MidAppr1Rating = new Rating();
ECR.MidAppr1Rating.RatingId = DataRow["MID_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating_ID"]));
ECR.MidAppr1Rating.Rate = DataRow["MID_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["MID_APPR1_Rating"]));
//Final Year end comments & rating
ECR.FinalSelfComments = DataRow["Final_SELF_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_SELF_COMMENTS"]));
ECR.FinalSelfRating = new Rating();
ECR.FinalSelfRating.RatingId = DataRow["Final_SELF_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating_ID"]));
ECR.FinalSelfRating.Rate = DataRow["Final_SELF_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_SELF_Rating"]));
ECR.FinalAppr1Rating = new Rating();
ECR.FinalAppr1Rating.RatingId = DataRow["Final_APPR1_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating_ID"]));
ECR.FinalAppr1Rating.Rate = DataRow["Final_APPR1_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR1_Rating"]));
ECR.FinalAppr1Comments = DataRow["Final_APPR1_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR1_COMMENTS"]));
ECR.FinalAppr2Rating = new Rating();
ECR.FinalAppr2Rating.RatingId = DataRow["Final_APPR2_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating_ID"]));
ECR.FinalAppr2Rating.Rate = DataRow["Final_APPR2_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR2_Rating"]));
ECR.FinalAppr2Comments = DataRow["Final_APPR2_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR2_COMMENTS"]));
ECR.FinalAppr3Rating = new Rating();
ECR.FinalAppr3Rating.RatingId = DataRow["Final_APPR3_Rating_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating_ID"]));
ECR.FinalAppr3Rating.Rate = DataRow["Final_APPR3_Rating"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Final_APPR3_Rating"]));
ECR.FinalAppr3Comments = DataRow["Final_APPR3_COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_APPR3_COMMENTS"]));
ECR.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ECR.BaseClass.Year = new AppraisalYear();
ECR.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ECR.BaseClass.CreateDate = DataRow["C_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["C_User_ID"]);
ECR.BaseClass.CreatedBy = DataRow["C_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["C_Date"]);
ECR.BaseClass.UpdatedBy = DataRow["U_User_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["U_User_ID"]);
ECR.BaseClass.UpdatedDate = DataRow["U_Date"] is DBNull ? default(string) : Convert.ToString(DataRow["U_Date"]);
ECR.BaseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
EmployeeCVOReviewList.Add(ECR);
}
}
if (ds.Tables[3].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[3].Rows)
{
EOD = new EmployeeQuestions
{
baseClass = new BaseClass(),
ques = new Questions(),
emp = new Employee(),
mgremp = new Employee(),
EMPQTID = DataRow["EMP_QT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_QT_ID"])),
EmpComments = DataRow["Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Emp_Comments"])),
MgrComments = DataRow["Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mgr_Comments"])),
MidEmpComments = DataRow["Mid_Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Emp_Comments"])),
MidMgrComments = DataRow["Mid_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Mgr_Comments"])),
FinalEmpComments = DataRow["Final_Emp_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Emp_Comments"])),
FinalMgrComments = DataRow["Final_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Mgr_Comments"])),
};
EOD.ques.QTID = DataRow["QT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["QT_ID"]));
EOD.ques.Desc = DataRow["QT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["QT_DESC"]));
EOD.ques.IDP = new IDP();
EOD.ques.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
EOD.ques.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
EOD.ques.IDP.Category = new Category();
EOD.ques.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
EOD.ques.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
EOD.ques.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
EOD.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
// EOD.emp.EmpName = DataRow["COMPT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_DESC"]));
objEmpQuestionsDetails.Add(EOD);
}
}
if (ds.Tables[4].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[4].Rows)
{
DT = new DevelopmentTarget
{
baseClass = new BaseClass(),
emp = new Employee(),
Mgremp = new Employee(),
IDP = new IDP(),
AssignmentRole = DataRow["Assignment_Role"] is DBNull ? default(string) : Convert.ToString((DataRow["Assignment_Role"])),
EMPDTID = DataRow["EMP_DT_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_DT_ID"])),
Objective = DataRow["Objective"] is DBNull ? default(string) : Convert.ToString((DataRow["Objective"])),
Timing = DataRow["Timing"] is DBNull ? default(string) : Convert.ToString((DataRow["Timing"])),
SpecificsNotes = DataRow["Specifics_Notes"] is DBNull ? default(string) : Convert.ToString((DataRow["Specifics_Notes"])),
MidNotes = DataRow["MidNotes"] is DBNull ? default(string) : Convert.ToString((DataRow["MidNotes"])),
FinalNotes = DataRow["FinalNotes"] is DBNull ? default(string) : Convert.ToString((DataRow["FinalNotes"])),
};
DT.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
DT.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
DT.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
DT.IDP.Category = new Category();
DT.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
DT.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
DT.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
objDevelopmentTarget.Add(DT);
}
}
if (ds.Tables[5].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[5].Rows)
{
DP = new DevelopmentPlan
{
baseClass = new BaseClass(),
emp = new Employee(),
Mgremp = new Employee(),
IDP = new IDP(),
DevelopmentAchieved = DataRow["Development_Achieved"] is DBNull ? default(string) : Convert.ToString((DataRow["Development_Achieved"])),
EMPDAPID = DataRow["EMP_DAP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_DAP_ID"])),
TobeComplete = DataRow["Tobe_Complete"] is DBNull ? default(string) : Convert.ToString((DataRow["Tobe_Complete"])),
Timing = DataRow["Timing"] is DBNull ? default(string) : Convert.ToString((DataRow["Timing"])),
MidtermStatus = DataRow["MidtermStatus"] is DBNull ? default(string) : Convert.ToString((DataRow["MidtermStatus"])),
FinalStatus = DataRow["FinalStatus"] is DBNull ? default(string) : Convert.ToString((DataRow["FinalStatus"])),
Mgr_Status = DataRow["Mgr_Status"] is DBNull ? default(string) : Convert.ToString((DataRow["Mgr_Status"])),
Status = DataRow["Status"] is DBNull ? default(string) : Convert.ToString((DataRow["Status"])),
MidMgrComments = DataRow["Mid_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Mid_Mgr_Comments"])),
FinalMgrComments = DataRow["Final_Mgr_Comments"] is DBNull ? default(string) : Convert.ToString((DataRow["Final_Mgr_Comments"])),
};
DP.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
DP.IDP.IDPID = DataRow["IDP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IDP_ID"]));
DP.IDP.IDPName = DataRow["IDP_desc"] is DBNull ? default(string) : Convert.ToString((DataRow["IDP_desc"]));
DP.IDP.Category = new Category();
DP.IDP.Category.CategoryId = DataRow["Category_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Category_ID"]));
DP.IDP.Category.CategoryName = DataRow["Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Name"]));
DP.IDP.Category.Type = DataRow["Type"] is DBNull ? default(string) : Convert.ToString((DataRow["Type"]));
objDevePlanDetails.Add(DP);
}
}
if (ds.Tables[6].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[6].Rows)
{
ET = new Training
{
baseClass = new BaseClass(),
emp = new Employee(),
SubCategory = new TrainingSubCategory(),
TDID = DataRow["TD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TD_ID"])),
ETDID = DataRow["ETD_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["ETD_ID"])),
Description = DataRow["TrainingDetails"] is DBNull ? default(string) : Convert.ToString((DataRow["TrainingDetails"])),
Duration = DataRow["Duration"] is DBNull ? default(string) : Convert.ToString((DataRow["Duration"])),
Mode = DataRow["Mode"] is DBNull ? default(string) : Convert.ToString((DataRow["Mode"])),
TrainingName = DataRow["TrainingName"] is DBNull ? default(string) : Convert.ToString((DataRow["TrainingName"])),
EndDate = DataRow["EndDate"] is DBNull ? default(DateTime) : Convert.ToDateTime((DataRow["EndDate"])),
StartDate = DataRow["StartDate"] is DBNull ? default(DateTime) : Convert.ToDateTime((DataRow["StartDate"])),
RejectdBy = DataRow["RejectdBy"] is DBNull ? default(string) : Convert.ToString((DataRow["RejectdBy"])),
RejectedReason = DataRow["RejectedReason"] is DBNull ? default(string) : Convert.ToString((DataRow["RejectedReason"])),
};
ET.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
ET.SubCategory.TSCID = DataRow["TSC_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TSC_ID"]));
ET.SubCategory.SubCatName = DataRow["SubCatName"] is DBNull ? default(string) : Convert.ToString((DataRow["SubCatName"]));
ET.SubCategory.TrainingCategory = new TrainingCategory();
ET.SubCategory.TrainingCategory.TCID = DataRow["TC_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TC_ID"]));
ET.SubCategory.TrainingCategory.CatName = DataRow["CatName"] is DBNull ? default(string) : Convert.ToString((DataRow["CatName"]));
ET.baseClass.StatusId = DataRow["STATUS_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["STATUS_ID"]));
objTraining.Add(ET);
}
}
if (ds.Tables[7].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[7].Rows)
{
RM = new Remarks
{
BaseClass = new BaseClass(),
emp = new Employee(),
rating = new Rating(),
EmpPotentail = new CommonType(),
RiskofLoss = new CommonType(),
RemarkId = DataRow["EMPRemark_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMPRemark_ID"])),
Remark = DataRow["Remarks"] is DBNull ? default(string) : Convert.ToString((DataRow["Remarks"])),
TotalValue = DataRow["TotalValue"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TotalValue"])),
IsPromotion = DataRow["Ispromotion"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Ispromotion"])),
PromotionRemarks = DataRow["PromotionRemarks"] is DBNull ? default(string) : Convert.ToString((DataRow["PromotionRemarks"])),
AppverID = DataRow["Approver_EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Approver_EMP_ID"])),
EmpType = DataRow["EmpType"] is DBNull ? default(string) : Convert.ToString((DataRow["EmpType"])),
IsVehicleRecomd = DataRow["IsVehicleRecomd"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IsVehicleRecomd"]))
};
RM.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMP_ID"]));
RM.rating.RatingId = DataRow["Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Rating_Id"]));
RM.BaseClass.StatusId = DataRow["STATUS_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["STATUS_ID"]));
RM.EmpPotentail.CId = DataRow["EPCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EPCID"]));
RM.RiskofLoss.CId = DataRow["RLCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["RLCID"]));
RM.EmpPotentail.Name = DataRow["EPCode"] is DBNull ? default(string) : Convert.ToString((DataRow["EPCode"]));
RM.RiskofLoss.Name = DataRow["RLCode"] is DBNull ? default(string) : Convert.ToString((DataRow["RLCode"]));
objRemarks.Add(RM);
}
}
if (ds.Tables[8].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[8].Rows)
{
CP = new CompetencyType
{
BaseClass = new BaseClass(),
Template = new TemplateMaster(),
ComptTypeId = DataRow["COMPT_TYPE_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["COMPT_TYPE_ID"])),
ComptTypeShortDesc = DataRow["COMPT_TYPE_SHORT_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_SHORT_DESC"])),
ComptTypeDesc = DataRow["COMPT_TYPE_DESC"] is DBNull ? default(string) : Convert.ToString((DataRow["COMPT_TYPE_DESC"])),
Weightage = DataRow["WEIGHTAGE"] is DBNull ? default(int) : Convert.ToInt32((DataRow["WEIGHTAGE"])),
ComptTypeSeq = DataRow["OrderBy"] is DBNull ? default(int) : Convert.ToInt32((DataRow["OrderBy"])),
};
CP.BaseClass.StatusId = DataRow["STATUS_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["STATUS_ID"]));
CP.Template.Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"]));
CP.Template.TMId = DataRow["TM_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["TM_ID"]));
objCompt.Add(CP);
}
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
//Status.StateCode = 1;
//Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
objIDPDetails.DevelopmentTarget = objDevelopmentTarget;
objIDPDetails.DevelopmentPlan = objDevePlanDetails;
objIDPDetails.EmployeeQuestions = objEmpQuestionsDetails;
ObjKraMappingDetails.EmployeeComptencyReview = EmployeeComptencyReviewList;
ObjKraMappingDetails.EmployeeRatingDetails = EmployeeRatingDetailslist;
ObjKraMappingDetails.EmployeeCVOReview = EmployeeCVOReviewList;
ObjKraMappingDetails.IDP = objIDPDetails;
ObjKraMappingDetails.Training = objTraining;
ObjKraMappingDetails.Remarks = objRemarks;
ObjKraMappingDetails.Comptetency = objCompt;
ObjKraMappingDetails.Status = Status;
if (ObjKraMappingDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeComptencyReviewDetails
{
Status = ObjKraMappingDetails.Status,
EmployeeComptencyReview = ObjKraMappingDetails.EmployeeComptencyReview,
EmployeeRatingDetails = ObjKraMappingDetails.EmployeeRatingDetails,
EmployeeCVOReview = ObjKraMappingDetails.EmployeeCVOReview,
IDP = ObjKraMappingDetails.IDP,
Training = ObjKraMappingDetails.Training,
Remarks = ObjKraMappingDetails.Remarks,
Comptetency = ObjKraMappingDetails.Comptetency
});
}
public async Task<Status> SaveEmployeeEndYearReviewDetails(string Data, string EmpCode, int CompanyId)
{
Status Status = new Status();
try
{
List<DbParameter> ParameterList = new List<DbParameter>();
ParameterList.Add(base.GetParameter("@JSONOUTPUT ", Data));
ParameterList.Add(base.GetParameter("@ActionBy", EmpCode));
ParameterList.Add(base.GetParameter("@CompanyId", CompanyId));
ParameterList.Add(base.GetParameterOut("@ErrorCode", SqlDbType.Int, 4));
ParameterList.Add(base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, 255));
base.ExecuteNonQuery(SPName.InsertUpdate_EmpEndYearReviewDetails, ParameterList);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
Status.StateCode = 1;
//Status.Message = "Data has been saved Successfully.";
Status.Message = "3003";
}
else
{
Status.Success = false;
Status.StateCode = 0;
Status.Message = "5014";
}
}
catch (Exception Ex)
{
Status.Success = false;
Status.StateCode = 0;
// Status.Message = Ex.Message;
Status.Message = "5014";
}
return await Task.Run(() => new Status
{
Success = Status.Success,
Message = Status.Message,
StateCode = Status.StateCode
});
}
public async Task<EmployeeRemarksDetails> GetPendingEmployeeEndYearReviewRequest(Search Search)
{
Status Status = new Status();
EmployeeRemarksDetails ObjRemarksDetails = new EmployeeRemarksDetails();
List<EmployeeRemarks> employeeRemarkslist = new List<EmployeeRemarks>();
RemarksDetails objRemarksobj = new RemarksDetails();
List<Remarks> Remarkslist = new List<Remarks>();
//Remarks remark = null;
EmployeeRemarks ERD = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@SiteId", Search.SiteId),
base.GetParameter("@EmpTypeId", Search.EmpTypeId),
base.GetParameter("@DeptId", Search.DeptId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_PendingEmployeeEndYearReviewRequest, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ERD = new EmployeeRemarks
{
emprating = new EmployeeRating(),
BaseClass = new BaseClass(),
emp = new Employee(),
empRemarks = new Remarks(),
Remarkslist = new List<Remarks>(),
allRemarks = DataRow["allremarks"] is DBNull ? default(string) : Convert.ToString((DataRow["allremarks"])),
};
ERD.emp.EmpId = DataRow["Emp_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Id"]));
ERD.emp.EmpName = DataRow["EMP_NAME"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_NAME"]));
ERD.emp.EmpCode = DataRow["EMP_CODE"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_CODE"]));
ERD.emp.EmailId = DataRow["EMAIL_ID"] is DBNull ? default(string) : Convert.ToString((DataRow["EMAIL_ID"]));
// ERD.emp.EmpImage = DataRow["EMP_IMAGE"] is DBNull ? default(byte) : Convert.ToByte((DataRow["EMP_IMAGE"]));
ERD.emprating.EmpRatDetId = DataRow["Emp_Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Rating_Id"]));
ERD.empRemarks.rating = new Rating();
ERD.empRemarks.rating.RatingId = DataRow["Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Rating_Id"]));
ERD.empRemarks.rating.Rate = DataRow["RATE"] is DBNull ? default(int) : Convert.ToInt32((DataRow["RATE"]));
ERD.empRemarks.rating.RatingGrade = DataRow["GRADE_CODE"] is DBNull ? default(string) : Convert.ToString((DataRow["GRADE_CODE"]));
ERD.empRemarks.Remark = DataRow["Remarks"] is DBNull ? default(string) : Convert.ToString((DataRow["Remarks"]));
ERD.empRemarks.RemarkId = DataRow["EMPRemark_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMPRemark_ID"]));
ERD.empRemarks.IsPromotion = DataRow["Ispromotion"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Ispromotion"]));
ERD.empRemarks.PromotionRemarks = DataRow["PromotionRemarks"] is DBNull ? default(string) : Convert.ToString((DataRow["PromotionRemarks"]));
ERD.empRemarks.IsVehicleRecomd = DataRow["IsVehicleRecomd"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IsVehicleRecomd"]));
ERD.empRemarks.EmpPotentail = new CommonType();
ERD.empRemarks.RiskofLoss = new CommonType();
ERD.empRemarks.EmpPotentail.CId = DataRow["EPCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EPCID"]));
ERD.empRemarks.RiskofLoss.CId = DataRow["RLCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["RLCID"]));
ERD.empRemarks.EmpPotentail.Name = DataRow["EPCode"] is DBNull ? default(string) : Convert.ToString((DataRow["EPCode"]));
ERD.empRemarks.RiskofLoss.Name = DataRow["RLCode"] is DBNull ? default(string) : Convert.ToString((DataRow["RLCode"]));
ERD.empRemarks.TotalValue = DataRow["TotalValue"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["TotalValue"]));
ERD.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ERD.BaseClass.Year = new AppraisalYear();
ERD.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ERD.BaseClass.StatusId = DataRow["StatusId"] is DBNull ? default(int) : Convert.ToInt32(DataRow["StatusId"]);
employeeRemarkslist.Add(ERD);
}
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
// ObjKraMappingDetails.EmployeeComptencyReview = EmployeeComptencyReviewList;
ObjRemarksDetails.Remarks = employeeRemarkslist;
ObjRemarksDetails.Status = Status;
if (ObjRemarksDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeRemarksDetails
{
Status = ObjRemarksDetails.Status,
// EmployeeComptencyReview = ObjKraMappingDetails.EmployeeComptencyReview,
Remarks = ObjRemarksDetails.Remarks,
});
}
public async Task<EmployeeRemarksDetails> GetPendingEmployeeRemarksRatingReviewDetails(Search Search)
{
Status Status = new Status();
EmployeeRemarksDetails ObjRemarksDetails = new EmployeeRemarksDetails();
List<EmployeeRemarks> employeeRemarkslist = new List<EmployeeRemarks>();
RemarksDetails objRemarksobj = new RemarksDetails();
List<Remarks> Remarkslist = new List<Remarks> ();
Remarks remark = null;
EmployeeRemarks ERD = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@SiteId", Search.SiteId),
base.GetParameter("@EmpTypeId", Search.EmpTypeId),
base.GetParameter("@DeptId", Search.DeptId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_PendingEmpRemarksRatingDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ERD = new EmployeeRemarks
{
emprating = new EmployeeRating(),
BaseClass = new BaseClass(),
emp = new Employee(),
empRemarks = new Remarks(),
Remarkslist = new List<Remarks>(),
};
ERD.emp.EmpId = DataRow["Emp_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Id"]));
ERD.emp.EmpName = DataRow["EMP_NAME"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_NAME"]));
ERD.emp.EmpCode = DataRow["EMP_CODE"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_CODE"]));
ERD.emp.EmailId = DataRow["EMAIL_ID"] is DBNull ? default(string) : Convert.ToString((DataRow["EMAIL_ID"]));
// ERD.emp.EmpImage = DataRow["EMP_IMAGE"] is DBNull ? default(byte) : Convert.ToByte((DataRow["EMP_IMAGE"]));
ERD.emprating.EmpRatDetId = DataRow["Emp_Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Rating_Id"]));
ERD.empRemarks.rating = new Rating();
ERD.empRemarks.rating.RatingId = DataRow["Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Rating_Id"]));
ERD.empRemarks.rating.Rate = DataRow["RATE"] is DBNull ? default(int) : Convert.ToInt32((DataRow["RATE"]));
ERD.empRemarks.rating.RatingGrade = DataRow["GRADE_CODE"] is DBNull ? default(string) : Convert.ToString((DataRow["GRADE_CODE"]));
ERD.empRemarks.Remark = DataRow["Remarks"] is DBNull ? default(string) : Convert.ToString((DataRow["Remarks"]));
ERD.empRemarks.RemarkId = DataRow["EMPRemark_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EMPRemark_ID"]));
ERD.empRemarks.IsPromotion = DataRow["Ispromotion"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Ispromotion"]));
ERD.empRemarks.PromotionRemarks = DataRow["PromotionRemarks"] is DBNull ? default(string) : Convert.ToString((DataRow["PromotionRemarks"]));
ERD.empRemarks.IsVehicleRecomd = DataRow["IsVehicleRecomd"] is DBNull ? default(int) : Convert.ToInt32((DataRow["IsVehicleRecomd"]));
ERD.empRemarks.EmpPotentail = new CommonType();
ERD.empRemarks.RiskofLoss = new CommonType();
ERD.empRemarks.EmpPotentail.CId = DataRow["EPCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["EPCID"]));
ERD.empRemarks.RiskofLoss.CId = DataRow["RLCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["RLCID"]));
ERD.empRemarks.EmpPotentail.Name = DataRow["EPCode"] is DBNull ? default(string) : Convert.ToString((DataRow["EPCode"]));
ERD.empRemarks.RiskofLoss.Name = DataRow["RLCode"] is DBNull ? default(string) : Convert.ToString((DataRow["RLCode"]));
ERD.empRemarks.TotalValue = DataRow["TotalValue"] is DBNull ? default(decimal) : Convert.ToDecimal((DataRow["TotalValue"]));
ERD.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ERD.BaseClass.Year = new AppraisalYear();
ERD.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
Remarkslist = new List<Remarks>();
if (ds.Tables[1].Rows.Count > 0)
{
DataRow[] dr = ds.Tables[1].Select("EMP_ID = " + ERD.emp.EmpId);
//int count = dr.Length;
foreach (DataRow DRow in dr)
{
remark = new Remarks();
remark.emp = new Employee();
remark.rating = new Rating();
remark.RemarkId = DRow["EMPRemark_ID"] is DBNull ? default(int) : Convert.ToInt32((DRow["EMPRemark_ID"]));
remark.PromotionRemarks = DRow["PromotionRemarks"] is DBNull ? default(string) : Convert.ToString((DRow["PromotionRemarks"]));
remark.IsPromotion = DRow["Ispromotion"] is DBNull ? default(int) : Convert.ToInt32((DRow["Ispromotion"]));
remark.IsVehicleRecomd = DRow["IsVehicleRecomd"] is DBNull ? default(int) : Convert.ToInt32((DRow["IsVehicleRecomd"]));
remark.Remark = DRow["Remarks"] is DBNull ? default(string) : Convert.ToString((DRow["Remarks"]));
remark.emp.EmpId = DRow["Emp_ID"] is DBNull ? default(int) : Convert.ToInt32((DRow["Emp_ID"]));
remark.emp.EmpName = DRow["EMP_NAME"] is DBNull ? default(string) : Convert.ToString((DRow["EMP_NAME"]));
remark.emp.EmpCode = DRow["EMP_CODE"] is DBNull ? default(string) : Convert.ToString((DRow["EMP_CODE"]));
remark.EmpPotentail = new CommonType();
remark.RiskofLoss = new CommonType();
remark.EmpPotentail.CId = DRow["EPCID"] is DBNull ? default(int) : Convert.ToInt32((DRow["EPCID"]));
remark.RiskofLoss.CId = DRow["RLCID"] is DBNull ? default(int) : Convert.ToInt32((DRow["RLCID"]));
remark.EmpPotentail.Name = DRow["EPCode"] is DBNull ? default(string) : Convert.ToString((DRow["EPCode"]));
remark.RiskofLoss.Name = DRow["RLCode"] is DBNull ? default(string) : Convert.ToString((DRow["RLCode"]));
remark.rating.RatingId = DRow["Rating_Id"] is DBNull ? default(int) : Convert.ToInt32((DRow["Rating_Id"]));
remark.rating.RatingGrade = DRow["GRADE_CODE"] is DBNull ? default(string) : Convert.ToString((DRow["GRADE_CODE"]));
remark.rating.Rate = DRow["RATE"] is DBNull ? default(int) : Convert.ToInt32((DRow["RATE"]));
Remarkslist.Add(remark);
}
}
ERD.Remarkslist = Remarkslist;
employeeRemarkslist.Add(ERD);
}
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
// ObjKraMappingDetails.EmployeeComptencyReview = EmployeeComptencyReviewList;
ObjRemarksDetails.Remarks = employeeRemarkslist;
ObjRemarksDetails.Status = Status;
if (ObjRemarksDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeRemarksDetails
{
Status = ObjRemarksDetails.Status,
// EmployeeComptencyReview = ObjKraMappingDetails.EmployeeComptencyReview,
Remarks = ObjRemarksDetails.Remarks,
});
}
public async Task<Status> SaveEndYearApproverRatingRemarks(string Data, string EmpCode)
{
Status Status = new Status();
try
{
List<DbParameter> ParameterList = new List<DbParameter>();
ParameterList.Add(base.GetParameter("@JSONOUTPUT ", Data));
ParameterList.Add(base.GetParameter("@ActionBy", EmpCode));
ParameterList.Add(base.GetParameterOut("@ErrorCode", SqlDbType.Int, 4));
ParameterList.Add(base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, 255));
base.ExecuteNonQuery(SPName.InsertUpdate_EndYearApproverRemarksls, ParameterList);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
Status.StateCode = 1;
//Status.Message = "Data has been saved Successfully.";
Status.Message = "3003";
}
else
{
Status.Success = false;
Status.StateCode = 0;
Status.Message = "5014";
}
}
catch (Exception Ex)
{
Status.Success = false;
Status.StateCode = 0;
Status.Message = Ex.Message;
Status.Message = "5014";
}
return await Task.Run(() => new Status
{
Success = Status.Success,
Message = Status.Message,
StateCode = Status.StateCode
});
}
public async Task<Status> SavePreviousMangerRequest(string Data, string EmpCode, int CompanyId)
{
Status Status = new Status();
try
{
List<DbParameter> ParameterList = new List<DbParameter>();
ParameterList.Add(base.GetParameter("@JSONOUTPUT ", Data));
ParameterList.Add(base.GetParameter("@ActionBy", EmpCode));
ParameterList.Add(base.GetParameter("@CompanyId", CompanyId));
ParameterList.Add(base.GetParameterOut("@ErrorCode", SqlDbType.Int, 4));
ParameterList.Add(base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, 255));
base.ExecuteNonQuery(SPName.InsertUpdate_EMP_Previous_Mgr_Feedback, ParameterList);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
Status.StateCode = 1;
//Status.Message = "Data has been saved Successfully.";
Status.Message = "3003";
}
else
{
Status.Success = false;
Status.StateCode = 0;
Status.Message = "5014";
}
}
catch (Exception Ex)
{
Status.Success = false;
Status.StateCode = 0;
// Status.Message = Ex.Message;
Status.Message = "5014";
}
return await Task.Run(() => new Status
{
Success = Status.Success,
Message = Status.Message,
StateCode = Status.StateCode
});
}
public async Task<PreviousMgrFeedbackDetails> GetPreviousMangerCommentsDetails(Search Search)
{
Status Status = new Status();
PreviousMgrFeedbackDetails ObjPrevMgrDetails = new PreviousMgrFeedbackDetails();
List<PreviousMgrFeedback> referbackList = new List<PreviousMgrFeedback>();
PreviousMgrFeedback refer = null;
int empCode =0;
int approvercode = 0;
if (Search.text.ToUpper() == "APPOVER")
{
approvercode = Search.EMPId;
}
if (Search.text.ToUpper() == "EMP")
{
empCode = Search.EMPId;
}
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@ApproverId", approvercode),
base.GetParameter("@EMPId", empCode),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataTable Dt = base.ExecuteDataTable(SPName.Get_EMP_Previous_Mgr_Feedback, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
refer = new PreviousMgrFeedback
{
baseClass = new BaseClass(),
emp = new Employee(),
Approver = new Employee(),
Processtype = new ProcessType(),
RATINGID = new Rating(),
FeedbackId = DataRow["FEEDBACK_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["FEEDBACK_ID"])),
Comment = DataRow["COMMENTS"] is DBNull ? default(string) : Convert.ToString((DataRow["COMMENTS"])),
RequesterComment = DataRow["Requester_Comment"] is DBNull ? default(string) : Convert.ToString((DataRow["Requester_Comment"])),
};
refer.emp.EmpId = DataRow["EMP_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["EMP_ID"]);
refer.emp.EmpCode = DataRow["EMP_CODE"] is DBNull ? default(string) : Convert.ToString(DataRow["EMP_CODE"]);
refer.emp.EmpName = DataRow["EMP_NAME"] is DBNull ? default(string) : Convert.ToString(DataRow["EMP_NAME"]);
refer.Approver.EmpId = DataRow["APPROVER_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["APPROVER_ID"]);
refer.Approver.EmpCode = DataRow["APPROVER_EMPCode"] is DBNull ? default(string) : Convert.ToString(DataRow["APPROVER_EMPCode"]);
refer.Approver.EmpName = DataRow["APPROVER_EMPName"] is DBNull ? default(string) : Convert.ToString(DataRow["APPROVER_EMPName"]);
refer.Processtype.Code = DataRow["PERIOD_CODE"] is DBNull ? default(string) : Convert.ToString(DataRow["PERIOD_CODE"]);
refer.RATINGID.RatingId = DataRow["RATING_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["RATING_ID"]);
refer.RATINGID.RatingDesc = DataRow["GRADE_CODE"] is DBNull ? default(string) : Convert.ToString(DataRow["GRADE_CODE"]);
refer.baseClass.StatusId = DataRow["STATUS_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["STATUS_ID"]);
referbackList.Add(refer);
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjPrevMgrDetails.PreviousMgrFeedback = referbackList;
ObjPrevMgrDetails.Status = Status;
if (ObjPrevMgrDetails == null)
{
return null;
}
return await Task.Run(() => new PreviousMgrFeedbackDetails
{
Status = ObjPrevMgrDetails.Status,
PreviousMgrFeedback = ObjPrevMgrDetails.PreviousMgrFeedback,
});
}
public async Task<ApproverYearWiseSetupDetails> GetApproverYearWiseSetup(Search Search)
{
Status Status = new Status();
ApproverYearWiseSetupDetails ObjApprSetup = new ApproverYearWiseSetupDetails();
List<ApproverYearWiseSetup> ApprList = new List<ApproverYearWiseSetup>();
ApproverYearWiseSetup appvr = null;
int empCode = 0;
int approvercode = 0;
if (Search.text == "Appover")
{
approvercode = Search.EMPId;
}
if (Search.text == "emp")
{
empCode = Search.EMPId;
}
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataTable Dt = base.ExecuteDataTable(SPName.Get_ApproverYearWiseSetup, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
appvr = new ApproverYearWiseSetup
{
baseClass = new BaseClass(),
APPCID = DataRow["APPCID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["APPCID"])),
CID = DataRow["CID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["CID"])),
Code = DataRow["Code"] is DBNull ? default(string) : Convert.ToString((DataRow["Code"])),
};
appvr.baseClass.Year = new AppraisalYear();
appvr.baseClass.Year.YearId = DataRow["Year_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Year_ID"]);
//appvr.baseClass.Year.Year = DataRow["Year"] is DBNull ? default(string) : Convert.ToString(DataRow["Year"]);
appvr.baseClass.CompanyId = DataRow["Company_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Company_ID"]);
appvr.baseClass.StatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Status_ID"]);
ApprList.Add(appvr);
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
ObjApprSetup.List = ApprList;
ObjApprSetup.Status = Status;
if (ObjApprSetup == null)
{
return null;
}
return await Task.Run(() => new ApproverYearWiseSetupDetails
{
Status = ObjApprSetup.Status,
List = ObjApprSetup.List,
});
}
public async Task<Status> SendMails(string Data, Search search)
{
Status Status = new Status();
try
{
List<DbParameter> ParameterList = new List<DbParameter>();
ParameterList.Add(base.GetParameter("@JSONOUTPUT ", Data));
ParameterList.Add(base.GetParameter("@ActionBy", search.EMPId));
ParameterList.Add(base.GetParameter("@CompanyId", search.CompanyId));
ParameterList.Add(base.GetParameterOut("@ErrorCode", SqlDbType.Int, 4));
ParameterList.Add(base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, 255));
base.ExecuteNonQuery(SPName.SendMail, ParameterList);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
Status.StateCode = 1;
//Status.Message = "Data has been saved Successfully.";
Status.Message = "3013";
}
else
{
Status.Success = false;
Status.StateCode = 0;
Status.Message = "5014";
}
}
catch (Exception Ex)
{
Status.Success = false;
Status.StateCode = 0;
// Status.Message = Ex.Message;
Status.Message = "5014";
}
return await Task.Run(() => new Status
{
Success = Status.Success,
Message = Status.Message,
StateCode = Status.StateCode
});
}
public async Task<EmployeeComptencyReviewDetails> GetRequestStatusDetails(Search Search)
{
Status Status = new Status();
EmployeeComptencyReviewDetails ObjKraMappingDetails = new EmployeeComptencyReviewDetails();
List<EmployeeRating> EmployeeRatingDetailslist = new List<EmployeeRating>();
EmployeeRating ERD = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EMPId", Search.EMPId),
base.GetParameter("@ProcessCode", Search.ProcCode),
base.GetParameter("@StatusId", Search.Status),
base.GetParameter("@SiteId", Search.SiteId),
base.GetParameter("@DeptId", Search.DeptId),
base.GetParameter("@Page", Search.Page),
base.GetParameter("@PerPage", Search.PerPage),
base.GetParameterOut("@TotalRowCount", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataSet ds = base.ExecuteDataSet(SPName.Get_RequestStatusDetails, ref ParameterArray);
Status.TotalRowCount = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@TotalRowCount")).Value);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in ds.Tables[0].Rows)
{
ERD = new EmployeeRating
{
BaseClass = new BaseClass(),
emp = new Employee(),
ApproversName = "",
Rating = new Rating(),
GoalStatus = new KRAStatus(),
MIDStatus = new KRAStatus(),
ENDStatus = new KRAStatus(),
Process = new ProcessType(),
};
ERD.emp.EmpId = DataRow["Emp_Id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Emp_Id"]));
ERD.emp.EmpName = DataRow["EMP_NAME"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_NAME"]));
ERD.emp.EmpCode = DataRow["EMP_CODE"] is DBNull ? default(string) : Convert.ToString((DataRow["EMP_CODE"]));
ERD.emp.EmailId = DataRow["EMAIL_ID"] is DBNull ? default(string) : Convert.ToString((DataRow["EMAIL_ID"]));
ERD.Process.Code = DataRow["Processcode"] is DBNull ? default(string) : Convert.ToString((DataRow["Processcode"]));
ERD.Process.Description = DataRow["ProcessDescription"] is DBNull ? default(string) : Convert.ToString((DataRow["ProcessDescription"]));
ERD.GoalStatus.KraStatusId = DataRow["Status_ID"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Status_ID"]));
ERD.GoalStatus.KraStatus = DataRow["Status_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["Status_Name"]));
ERD.GoalStatus.SelfVisable = DataRow["Self_Status_id"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Self_Status_id"]));
ERD.GoalStatus.ApproverVisable = DataRow["Approver_statusId"] is DBNull ? default(int) : Convert.ToInt32((DataRow["Approver_statusId"]));
//ERD.GoalStatus.SelfVisable = DataRow["isSelf_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["isSelf_Visable"]));
//ERD.GoalStatus.ApproverVisable = DataRow["isApprover_Visable"] is DBNull ? default(int) : Convert.ToInt32((DataRow["isApprover_Visable"]));
ERD.ENDStatus.KraStatus = DataRow["Status_Name"] is DBNull ? default(string) : Convert.ToString((DataRow["ENDStatus_Name"]));
ERD.BaseClass.CompanyId = DataRow["COMPANY_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["COMPANY_ID"]);
ERD.BaseClass.Year = new AppraisalYear();
ERD.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
ERD.BaseClass.Year.Year = DataRow["DisplayYear"] is DBNull ? default(string) : Convert.ToString(DataRow["DisplayYear"]);
EmployeeRatingDetailslist.Add(ERD);
}
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
// ObjKraMappingDetails.EmployeeComptencyReview = EmployeeComptencyReviewList;
ObjKraMappingDetails.EmployeeRatingDetails = EmployeeRatingDetailslist;
ObjKraMappingDetails.Status = Status;
if (ObjKraMappingDetails == null)
{
return null;
}
return await Task.Run(() => new EmployeeComptencyReviewDetails
{
Status = ObjKraMappingDetails.Status,
// EmployeeComptencyReview = ObjKraMappingDetails.EmployeeComptencyReview,
EmployeeRatingDetails = ObjKraMappingDetails.EmployeeRatingDetails,
});
}
#region Attachment File
public async Task<Status> UploadFiles(List<IFormFile> files, Search search)
{
Status Status = null;
string DeleteId = string.Empty;
try
{
Status = new Status();
if (files.Count > 0)
{
Status = await base.ExecuteNonQueryTransaction(SPName.Insert_Update_EmpAttachments, files, search); //Exception handling already in this
if (Status.Success) // cal for delete attachment
{
DeleteId = string.Empty;
var _file = JsonConvert.DeserializeObject<List<FileUploadObject>>(search.text);
for (int j = 0; j < _file.Count; j++)
{
if (_file[j].FileOperation.ToString() == "1")
{
if (DeleteId == string.Empty)
{ DeleteId = _file[j].EAID; }
else
{ DeleteId = DeleteId + ";" + _file[j].EAID; }
}
}
if (!string.IsNullOrEmpty(DeleteId))
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@DocumentId", DeleteId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
base.ExecuteNonQuery(SPName.Delete_EmpDocument, ParameterList);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
}
else
{
Status.Success = false;
}
}
}
}
else
{
DeleteId = string.Empty;
var _file = JsonConvert.DeserializeObject<List<FileUploadObject>>(search.text);
for (int j = 0; j < _file.Count; j++)
{
if (_file[j].FileOperation.ToString() == "1")
{
if (DeleteId == string.Empty)
{ DeleteId = _file[j].EAID; }
else
{ DeleteId = DeleteId + ";" + _file[j].EAID; }
}
}
if (!string.IsNullOrEmpty(DeleteId))
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@DocumentId", DeleteId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
base.ExecuteNonQuery(SPName.Delete_EmpDocument, ParameterList);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
Status.Success = true;
}
else
{
Status.Success = false;
}
}
}
}
catch (Exception Ex)
{
throw Ex;
}
return Status;
}
public async Task<AttachmentTypeDetails> GetUserAttachments(Search search)
{
Status Status = new Status();
AttachmentTypeDetails AtchmntDetails = new AttachmentTypeDetails();
List<AttachmentType> AtchmntList = new List<AttachmentType>();
AttachmentType AtchmntData = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId",search.CompanyId),
base.GetParameter("@YearId",search.YearId),
base.GetParameter("@EmpId", search.EMPId),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataTable Dt = base.ExecuteDataTable(SPName.Get_EmpAttachments, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
AtchmntData = new AttachmentType();
AtchmntData.BaseClass = new BaseClass();
AtchmntData.BaseClass.Year = new AppraisalYear();
//QCDData.employee = new Employee();
//QCDData.baseclass = new BaseClass();
AtchmntData.Description = DataRow["AttachmentType"] is DBNull ? default(string) : Convert.ToString(DataRow["AttachmentType"]);
AtchmntData.EAId = DataRow["EA_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["EA_ID"]);
AtchmntData.AttachmentName = DataRow["AttachmentName"] is DBNull ? default(string) : Convert.ToString(DataRow["AttachmentName"]);
AtchmntData.Reference = DataRow["DocumentReference"] is DBNull ? default(string) : Convert.ToString(DataRow["DocumentReference"]);
// AtchmntData.UploadedBy = DataRow["UploadedBy"] is DBNull ? default(string) : Convert.ToString(DataRow["UploadedBy"]);
// AtchmntData.UploadedDate = DataRow["UploadedDate"] is DBNull ? default(string) : Convert.ToString(DataRow["UploadedDate"]);
AtchmntData.BaseClass.Year.YearId = DataRow["YEAR_ID"] is DBNull ? default(int) : Convert.ToInt32(DataRow["YEAR_ID"]);
AtchmntList.Add(AtchmntData);
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
else
{
Status.Success = false;
}
}
catch (Exception Ex)
{
throw Ex;
}
AtchmntDetails.AttachmentTypeList = AtchmntList;
AtchmntDetails.Status = Status;
if (AtchmntDetails == null)
{
return null;
}
return await Task.Run(() => new AttachmentTypeDetails
{
Status = AtchmntDetails.Status,
AttachmentTypeList = AtchmntDetails.AttachmentTypeList,
});
}
public FileResult Download(Search search)
{
FileContentResult Result = null;
FileUpload FileUpload = null;
Status Status = new Status();
var Memory = new MemoryStream();
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@DocumentId", search.Id),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to
DataTable Dt = base.ExecuteDataTable( SPName.Get_EmpDocument, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
FileUpload = new FileUpload
{
FileId = DataRow["EA_ID"] is DBNull ? default(string) : Convert.ToString(DataRow["EA_ID"]),
FileName = DataRow["AttachmentName"] is DBNull ? default(string) : Convert.ToString(DataRow["AttachmentName"]),
FileContent = DataRow["AttachmentData"] is DBNull ? default(byte[]) : (byte[])(DataRow["AttachmentData"]),
FileType = DataRow["ContentType"] is DBNull ? default(string) : Convert.ToString(DataRow["ContentType"])
};
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
else
{
Status.Success = false;
}
Result = new FileContentResult(FileUpload.FileContent, FileUpload.FileType)
{
FileDownloadName = FileUpload.FileName
};
}
catch (Exception Ex)
{
throw Ex;
}
return Result;
}
public async Task<CalculationDetails> GetRatingCalculation(Search Search)
{
Status Status = new Status();
CalculationDetails objCalDetails = new CalculationDetails();
List<CalculateRating> CalRating = new List<CalculateRating>();
CalculateRating cal = null;
try
{
List<DbParameter> ParameterList = new List<DbParameter>
{
base.GetParameter("@CompanyId", Search.CompanyId),
base.GetParameter("@YearId", Search.YearId),
base.GetParameter("@EmpId", Search.EMPId),
base.GetParameter("@ProcessCode", Search.ProcCode),
base.GetParameterOut("@ErrorCode", SqlDbType.Int, null, ParameterDirection.Output), //parameter value is null here
base.GetParameterOut("@ErrorDesc", SqlDbType.NVarChar, null, ParameterDirection.Output) //parameter value is null here
};
DbParameter[] ParameterArray = ParameterList.ToArray(); ///convert db parameter from list to array
DataTable Dt = base.ExecuteDataTable(SPName.Get_CalculationDetails, ref ParameterArray);
Status.StateCode = Convert.ToInt32(ParameterList.Find(x => x.ParameterName.Contains("@ErrorCode")).Value);
Status.Message = (string)ParameterList.Find(x => x.ParameterName.Contains("@ErrorDesc")).Value;
if (Status.StateCode == 0)
{
if (Dt.Rows.Count > 0)
{
Status.Success = true;
foreach (DataRow DataRow in Dt.Rows)
{
cal = new CalculateRating();
cal.CompType = DataRow["Comptype"] is DBNull ? default(string) : Convert.ToString(DataRow["Comptype"]);
cal.Formula = DataRow["CalCulation"] is DBNull ? default(string) : Convert.ToString(DataRow["CalCulation"]);
cal.Weightage = DataRow["Weightage"] is DBNull ? default(int) : Convert.ToInt32(DataRow["Weightage"]);
cal.MgrScore = DataRow["MgrScore"] is DBNull ? default(int) : Convert.ToInt32(DataRow["MgrScore"]);
cal.MgrRating = DataRow["MgrRating"] is DBNull ? default(string) : Convert.ToString(DataRow["MgrRating"]);
cal.SelfScore = DataRow["SelfScore"] is DBNull ? default(int) : Convert.ToInt32(DataRow["SelfScore"]);
cal.SelfRating = DataRow["SelfRating"] is DBNull ? default(string) : Convert.ToString(DataRow["SelfRating"]);
CalRating.Add(cal);
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";//No Recoords
}
}
else
{
Status.Success = false;
Status.StateCode = 1;
Status.Message = "3002";
}
}
catch (Exception Ex)
{
throw Ex;
}
objCalDetails.Calculate = CalRating;
objCalDetails.Status = Status;
if (objCalDetails == null)
{
return null;
}
return await Task.Run(() => new CalculationDetails
{
Status = objCalDetails.Status,
Calculate = objCalDetails.Calculate,
});
}
#endregion
}
}
Comments
Post a Comment