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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
            }
        }
예제 #7
0
        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));
        }
예제 #9
0
        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));
        }
예제 #10
0
        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));
        }
예제 #11
0
        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);
        }
예제 #12
0
        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);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
        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));
        }
예제 #16
0
        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));
        }