public IEnumerable <Account> Recommender() { SqlCommand cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@QueryType", 0); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); List <Account> items = new List <Account>(); if (dt != null) { foreach (DataRow dr in dt.Rows) { var item = new Account { Id = int.Parse(dr["Id"].ToString()), FirstName = dr["Firstname"].ToString(), MiddleName = dr["Middlename"].ToString(), LastName = dr["Lastname"].ToString(), }; items.Add(item); } } return(items); }
public IEnumerable <EmployeeInformation> Employees(string keyword) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Keyword", keyword); cmd.Parameters.AddWithValue("@QueryType", 2); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); List <EmployeeInformation> items = new List <EmployeeInformation>(); if (dt != null) { foreach (DataRow dr in dt.Rows) { var item = new EmployeeInformation { Id = int.Parse(dr["Id"].ToString()), Name = dr["Name"].ToString(), EmployeeNo = dr["EmployeeNo"].ToString(), Category = dr["Category"].ToString(), Company = dr["Company"].ToString(), Branch = dr["Branch"].ToString(), Department = dr["Department"].ToString(), Position = dr["Position"].ToString(), }; items.Add(item); } } return(items); }
public IEnumerable <EmployeePerformance> EmployeePerformances(int period, int id) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "[dbo].[spEmployeePerformance]"; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@SeasonId", period); cmd.Parameters.AddWithValue("@EmployeeId", id); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); List <EmployeePerformance> items = new List <EmployeePerformance>(); if (dt != null) { foreach (DataRow dr in dt.Rows) { var item = new EmployeePerformance { Id = int.Parse(dr["Id"].ToString()), Name = dr["EmployeeName"].ToString(), Period = dr["Period"].ToString(), TotalScore = decimal.Parse(dr["TotalScore"].ToString()), TotalWeight = decimal.Parse(dr["TotalWeight"].ToString()), ConvertedScore = decimal.Parse(dr["ConvertedScore"].ToString()), WeightedScore = decimal.Parse(dr["WeightedScore"].ToString()), Percentage = decimal.Parse(dr["Percentage"].ToString()), }; items.Add(item); } } return(items); }
public IEnumerable <PeerRatingDetailed> PeerDetailedRating(int period, int employee) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "[dbo].[spPeerEvaluationReport]"; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Period", period); cmd.Parameters.AddWithValue("@Id", employee); cmd.Parameters.AddWithValue("@QueryType", 1); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); List <PeerRatingDetailed> items = new List <PeerRatingDetailed>(); if (dt != null) { foreach (DataRow dr in dt.Rows) { var item = new PeerRatingDetailed { Id = int.Parse(dr["Id"].ToString()), Period = dr["Period"].ToString(), Name = dr["Name"].ToString(), Rater = dr["Rater"].ToString(), Score = decimal.Parse(dr["Score"].ToString()), Weight = decimal.Parse(dr["Weight"].ToString()), TotalScore = decimal.Parse(dr["Average"].ToString()), }; items.Add(item); } } return(items); }
public IEnumerable <EvaluationReport> Evaluations(int periodid, string type) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@EvaluationSeason", periodid); cmd.Parameters.AddWithValue("@Type", type); cmd.Parameters.AddWithValue("@QueryType", 1); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); List <EvaluationReport> items = new List <EvaluationReport>(); if (dt != null) { foreach (DataRow dr in dt.Rows) { var item = new EvaluationReport { Id = int.Parse(dr["Id"].ToString()), Name = dr["Name"].ToString(), Rater = dr["Rater"].ToString(), Period = dr["Period"].ToString(), Type = dr["Type"].ToString(), Status = dr["Status"].ToString(), DateCreated = dr["DateCreated"].ToString() }; items.Add(item); } } return(items); }
public GeneralSettingModel GetSettings() { SqlCommand cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; var result = SCObjects.ExecGetData(cmd, Properties.Settings.Default.UserConnectionString); if (result != null) { var item = new GeneralSettingModel { ParkingName = result.Rows[0]["ParkingName"].ToString(), TIN = result.Rows[0]["TIN"].ToString(), Company = result.Rows[0]["Company"].ToString(), Address1 = result.Rows[0]["Address1"].ToString(), Address2 = result.Rows[0]["Address2"].ToString(), Address3 = result.Rows[0]["Address3"].ToString(), PhoneNumber = result.Rows[0]["PhoneNumber"].ToString(), Address = result.Rows[0]["Address"].ToString(), }; return(item); } else { return(null); } }
public DataTable GetRegularParkerDataTable() { var cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; var result = SCObjects.ExecGetData(cmd, Properties.Settings.Default.UserConnectionString); return(result); }
public DataTable AccountInfo(int id) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Id", id); cmd.Parameters.AddWithValue("@QueryType", 0); return(SCObjects.ExecGetData(cmd, UserConnectionString)); }
public DataTable GetApprovalLevel(int id) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@EmployeeId", id); cmd.Parameters.AddWithValue("@QueryType", 4); return(SCObjects.ExecGetData(cmd, UserConnectionString)); }
public DataTable GetAllKRARecordPerId(int recordid) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@RecordId", recordid); cmd.Parameters.AddWithValue("@QueryType", 2); return(SCObjects.ExecGetData(cmd, UserConnectionString)); }
private DataTable BehavioralDetails(int id) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "[dbo].[spBehavioralReport]"; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Id", id); cmd.Parameters.AddWithValue("@QueryType", 1); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); dt.TableName = "Behavioral"; return(dt); }
private DataTable KRAHeader(int id) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "[dbo].[spKRAReport]"; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Id", id); cmd.Parameters.AddWithValue("@QueryType", 0); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); dt.TableName = "Header"; return(dt); }
private DataTable PerformanceDetails(int id, int period) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "[dbo].[spEmployeePerformanceReport]"; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Id", id); cmd.Parameters.AddWithValue("@SeasonId", period); cmd.Parameters.AddWithValue("@QueryType", 1); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); dt.TableName = "Details"; return(dt); }
public DataTable AuditTrailDataTable(DateTime from, DateTime to, string terminal, string keyword) { var cmd = new SqlCommand(); cmd.CommandText = StoredProcedure; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@DateFrom", from); cmd.Parameters.AddWithValue("@DateTo", to); cmd.Parameters.AddWithValue("@Keyword", keyword); cmd.Parameters.AddWithValue("@Terminal", terminal); var result = SCObjects.ExecGetData(cmd, Properties.Settings.Default.UserConnectionString); return(result); }
public ActionResult PrintGraphicalDistribution(int period) { DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "[dbo].[spGraphicalDestribution]"; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@SeasonId", period); var dt = SCObjects.ExecGetData(cmd, UserConnectionString); dt.TableName = "Interpretation"; ds.Tables.Add(dt); var ReportParth = Server.MapPath("~/Reports/GraphicalDistribution.rpt"); return(new CrystalReportToPdf(ReportParth, ds)); }
public ActionResult PrintEmployeeInformation(int id) { DataSet ds = new DataSet(); ds.DataSetName = "dsInformation"; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "[dbo].[spEmployeeInformationReport]"; cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@Id", id); cmd.Parameters.AddWithValue("@QueryType", 0); DataTable dt = SCObjects.ExecGetData(cmd, UserConnectionString); dt.TableName = "EmployeeInfo"; ds.Tables.Add(dt); var ReportParth = Server.MapPath("~/Reports/EmployeeInformation.rpt"); return(new CrystalReportToPdf(ReportParth, ds)); }