示例#1
0
        public List <Models.ReportModel> GetReport(List <Models.ReportModel> Report, int employeeid, DateTime startdate, DateTime enddate)
        {
            var dbCon = DBConnection;

            if (dbCon.IsConnect())
            {
                string query  = string.Format("SELECT rollid, queueid, employeeid, taskid, startdate, stopdate, minutes, rate FROM queueroll Where employeeid={0} and stopdate between '{1}' and '{2}'", employeeid, startdate, enddate);
                var    cmd    = new MySqlCommand(query, dbCon.Connection);
                var    reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    Models.ReportModel ReportItem = new Models.ReportModel
                    {
                        RollId     = int.Parse(reader["rollid"].ToString()),
                        QueueId    = int.Parse(reader["queueid"].ToString()),
                        EmployeeId = int.Parse(reader["employeeid"].ToString()),
                        TaskId     = int.Parse(reader["taskid"].ToString()),
                        StartDate  = DateTime.Parse(reader["startdate"].ToString()),
                        StopDate   = DateTime.Parse(reader["stopdate"].ToString()),
                        Minutes    = double.Parse(reader["minutes"].ToString()),
                        Rate       = decimal.Parse(reader["rate"].ToString()),
                    };


                    Report.Add(ReportItem);
                }
                dbCon.Close();
            }

            return(Report);
        }
        public List <Models.ReportModel> GetCoReport()
        {
            Models.ReportModel        model    = null;
            List <Models.ReportModel> coreport = new List <Models.ReportModel>();

            using (SqlConnection cn = new SqlConnection(connectionString))
            {
                SqlCommand cmd = new SqlCommand("SELECT * FROM [dbo].[User_Table] WHERE Roles ='Student' ORDER BY Username", cn);
                cn.Open();
                SqlDataReader rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    model                            = new Models.ReportModel();
                    model.Username                   = Convert.ToString(rd.GetSqlValue(2));
                    model.Id                         = Int32.Parse(Convert.ToString(rd.GetSqlValue(0)));
                    model.Student_Name               = Convert.ToString(rd.GetSqlValue(4));
                    model.Status                     = Convert.ToString(rd.GetSqlValue(14));
                    model.Faculty_Supervisor_Name    = Convert.ToString(rd.GetSqlValue(22));
                    model.Industrial_Supervisor_Name = Convert.ToString(rd.GetSqlValue(23));
                    model.Evaluation_Mark            = GetEvaluationMark(model.Username);
                    coreport.Add(model);
                }
            }
            return(coreport);
        }
示例#3
0
        public List <ReportModel> GetReports(Models.ReportModel model)
        {
            if (model.linput == null || model.rinput == null)
            {
                List <ReportModel> rist = new List <ReportModel>();
                rist.Add(new ReportModel());
                rist[0].TransactionId = -1;
                return(rist);
            }
            string dateFrom = model.linput.ToString();

            dateFrom += " 00:00:01";
            string dateTo = model.rinput.ToString();

            dateTo += " 23:59:59";
            List <ReportModel> list = SubReports(dateFrom, dateTo);

            //list.Add(SubReports());
            if (list[0].TransactionId == -1)
            {
                return(list);
            }
            dateFrom = "\'" + dateFrom + "\'";
            dateTo   = "\'" + dateTo + "\'";
            using (MySqlConnection conn = GetConnection())
            {
                conn.Open();
                MySqlCommand cmd = new MySqlCommand("select * from Item_Purchase where Purchase_Date BETWEEN " + dateFrom + " AND " + dateTo, conn);

                using (var reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        list.Add(new ReportModel
                        {
                            TransactionId = Convert.ToInt32(reader["Transaction_Id"]),
                            ItemId        = Convert.ToInt32(reader["Item_Id"]),
                            CustomerId    = Convert.ToInt32(reader["Customer_Id"]),
                            TotalCost     = (float)reader["Total_Cost"],
                            PurchaseDate  = Convert.ToDateTime(reader["Purchase_Date"]),
                            Quantity      = Convert.ToInt32(reader["Quantity"]),
                        });
                    }
                    return(list);
                }
            }
        }
示例#4
0
 public Models.ReportModel GetStudentReport()
 {
     Models.ReportModel model = new Models.ReportModel();
     using (SqlConnection cn = new SqlConnection(connectionString))
     {
         SqlCommand cmd = new SqlCommand("SELECT * FROM [dbo].[User_Table] WHERE Username = '******'", cn);
         cn.Open();
         SqlDataReader rd = cmd.ExecuteReader();
         while (rd.Read())
         {
             model.Id                         = Int32.Parse(Convert.ToString(rd.GetSqlValue(0)));
             model.Student_Name               = Convert.ToString(rd.GetSqlValue(2));
             model.Status                     = Convert.ToString(rd.GetSqlValue(14));
             model.Faculty_Supervisor_Name    = Convert.ToString(rd.GetSqlValue(12));
             model.Industrial_Supervisor_Name = Convert.ToString(rd.GetSqlValue(13));
             model.Evaluation_Mark            = Convert.ToString(rd.GetSqlValue(15));
         }
     }
     return(model);
 }
示例#5
0
        public Models.ReportModel GetReleaseReport()
        {
            Models.ReportModel report = new Models.ReportModel();
            using (SqlConnection cn = new SqlConnection(connectionString))
            {
                SqlCommand cmd = new SqlCommand("SELECT * FROM [dbo].[User_Table] WHERE Username = '******'", cn);
                cn.Open();
                SqlDataReader rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    report.Id               = Int32.Parse(Convert.ToString(rd.GetSqlValue(0)));
                    report.Student_Name     = Convert.ToString(rd.GetSqlValue(2));
                    report.Matric_Id        = Convert.ToString(rd.GetSqlValue(5));
                    report.Company_Name     = Convert.ToString(rd.GetSqlValue(9));
                    report.State            = Convert.ToString(rd.GetSqlValue(8));
                    report.Status           = Convert.ToString(rd.GetSqlValue(14));
                    report.Internship_Start = Convert.ToString(rd.GetSqlValue(16));
                    report.Internship_End   = Convert.ToString(rd.GetSqlValue(17));
                }
            }

            return(report);
        }
示例#6
0
 public ReportDateFilterView(Models.ReportModel _rm)
 {
     InitializeComponent();
     DataContext = new ViewModels.ReportDateFilterViewModel(_rm);
 }
示例#7
0
 public ActionResult ReleaseReportView()
 {
     Models.ReportModel ReleaseReport = new Models.ReportModel();
     ReleaseReport = GetReleaseReport();
     return(View(ReleaseReport));
 }
示例#8
0
 public ActionResult StdReportView()
 {
     Models.ReportModel report = new Models.ReportModel();
     report = GetStudentReport();
     return(View(report));
 }
示例#9
0
 public ReportViewModel(Models.ReportModel _rm)
 {
     //ReportData = GetExcelReportData(_rm.Parameter);
     //ReportTitle = _rm.Header;
 }
示例#10
0
 public ReportPresenter(Views.IReportView view)
     : base(view)
 {
     Model = new Models.ReportModel();
 }
 public ReportDateFilterViewModel(Models.ReportModel _rm)
 {
     _reportname = _rm.Parameter;
     ReportTitle = _rm.Header;
     DataMonth   = DateTime.Now;
 }
示例#12
0
        public IActionResult Report(Models.ReportModel model)
        {
            Models.ReportContext context = HttpContext.RequestServices.GetService(typeof(Models.ReportContext)) as Models.ReportContext;

            return(View(context.GetReports(model)));
        }