Example #1
0
        public void DownloadEvdata()
        {
            var exXls = new ExportXls();
            var filename =  "学员考核信息.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("学员编号");
            fieldsNames.Add("姓名");
            fieldsNames.Add("性别");
            fieldsNames.Add("路局");
            fieldsNames.Add("站段");
            fieldsNames.Add("单位及职务");
            fieldsNames.Add("学历");
            fieldsNames.Add("身份证号");
            fieldsNames.Add("工作证号");
            fieldsNames.Add("公免票号");
            fieldsNames.Add("手机号码");
            fieldsNames.Add("开班日期");
            fieldsNames.Add("岗位工种");
            fieldsNames.Add("最终综合考核评分");

            var ds = new DataSet();
            var dt = new DataTable();
            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("性别", typeof(string));
            dt.Columns.Add("路局", typeof(string));
            dt.Columns.Add("站段", typeof(string));
            dt.Columns.Add("单位及职务", typeof(string));
            dt.Columns.Add("学历", typeof(string));
            dt.Columns.Add("身份证号", typeof(string));
            dt.Columns.Add("工作证号", typeof(string));
            dt.Columns.Add("公免票号", typeof(string));
            dt.Columns.Add("手机号码", typeof(string));
            dt.Columns.Add("开班日期", typeof(string));
            dt.Columns.Add("岗位工种", typeof(string));
            dt.Columns.Add("最终综合考核评分", typeof(string));
            dt.AcceptChanges();

            Expression<Func<Student, bool>> where = PredicateExtensionses.True<Student>();

                if (!string.IsNullOrEmpty(Request["Name"]))
                    {
                        var name = Request["Name"];
                        where = where.And(m => m.Name.Contains(name));
                    }
                    if (!string.IsNullOrEmpty(Request["Gender"]) && Request["Gender"] != "0")
                    {
                        var gender = Request["Gender"];
                        where = where.And(m => m.Gender == gender);
                    }
                    if (!string.IsNullOrEmpty(Request["DeptName"]))
                    {
                        var deptName = Request["DeptName"];
                        where = where.And(m => m.DeptName.Contains(deptName));
                    }
                    if (!string.IsNullOrEmpty(Request["StuNo"]))
                    {
                        var stuNo = Request["StuNo"];
                        where = where.And(m => m.StuNo.Contains(stuNo));
                    }
                    if (!string.IsNullOrEmpty(Request["StuTime"]))
                    {
                        var stuTime = Convert.ToDateTime(Request["StuTime"]);
                        where = where.And(m => m.StuTime >= stuTime);
                    }
                    if (!string.IsNullOrEmpty(Request["IdNo"]))
                    {
                        var IdNo = Request["IdNo"];
                        where = where.And(m => m.IdNo.Contains(IdNo));
                    }
                    //if (!string.IsNullOrEmpty(Request["Ustatus"]))
                    //{
                    //    var ustatus = Convert.ToInt32(Request["Ustatus"]);
                    //    where = where.And(m => m.Ustatus == ustatus);
                    //}

              //  where = where.And(m => m.Ustatus == (int)EnumStatus.Valid);
            where = where.And(m => m.IsValid);
            var entitys = unitOfWork.StudentBLL.GetEntitys(where).OrderBy(m => m.Luju).OrderBy(m => m.ParentName);

            if (entitys != null && entitys.Any())
            {
                foreach (var student in entitys)
                {
                    var row = dt.NewRow();
                    row["学员编号"] = student.StuNo;
                    row["姓名"] = student.Name;
                    row["性别"] = student.GenderName;
                    row["路局"] = student.Luju;
                    row["站段"] = student.Zhanduan;
                    row["单位及职务"] = student.DeptName;
                    row["学历"] = student.EducationName;
                    row["身份证号"] = student.IdNo;
                    row["工作证号"] = student.WorkIdNo;
                    row["公免票号"] = student.TickNo;
                    row["手机号码"] = student.CellPhoneNo;

                    //var entityss = unitOfWork.ClassInfoBLL.GetEntitys(m => m.Id == student.ParentId);
                    //if (entityss.Any())
                    //{
                    //    row["班级名称"] = entityss.ToArray()[0].Name;
                    //    row["开班日期"] = Convert.ToDateTime(entityss.ToArray()[0].BeginTime).ToString("yyyy-MM-dd");

                    //}
                    //else
                    //{
                    //    row["班级名称"] = "";
                    //    row["开班日期"] = "";
                    //}
                    row["开班日期"] = student.StuTime.ToString("yyyy-MM-dd");
                    row["岗位工种"] = student.PostName;
                    row["最终综合考核评分"] = student.Score;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #2
0
        public void DownloadAttendancedata()
        {
            var exXls = new ExportXls();
            var filename = "班级考勤信息.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("姓名");
            fieldsNames.Add("班级名称");
            fieldsNames.Add("日期");
            fieldsNames.Add("考勤结果");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("日期", typeof(string));
            dt.Columns.Add("考勤结果", typeof(string));
            dt.AcceptChanges();

            Expression<Func<StuAttendance, bool>> where = PredicateExtensionses.True<StuAttendance>();
            if (!string.IsNullOrEmpty(Request["Name"]))
            {
                var name = Request["Name"];
                where = where.And(m => m.StuName.Contains(name));
            }
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var ClassName = Request["ClassName"];
                where = where.And(m => m.ClassName.Contains(ClassName));
            }
            if (!string.IsNullOrEmpty(Request["Result"]))
            {
                var result = Convert.ToInt32(Request["Result"]);
                where = where.And(m => m.Result == result);
            }
            if (!string.IsNullOrEmpty(Request["TheDateBegin"]))
            {
                var begindate = Convert.ToDateTime(Request["TheDateBegin"]);
                where = where.And(m => m.TheDate >= begindate);
            }
            if (!string.IsNullOrEmpty(Request["TheDateEnd"]))
            {
                var endDate = Convert.ToDateTime(Request["TheDateEnd"]);
                where = where.And(m => m.TheDate <= endDate);
            }

            where = where.And(m => m.IsValid);
            var entitys = unitOfWork.StuAttendanceBLL.GetEntitys(where).OrderByDescending(m => m.TheDate);

            if (entitys != null && entitys.Any())
            {
                foreach (var head in entitys)
                {
                    var row = dt.NewRow();
                    row["姓名"] = head.StuName;
                    row["班级名称"] = head.ClassName;
                    row["日期"] = Convert.ToDateTime(head.TheDate).ToString("yyyy-MM-dd");
                    row["考勤结果"] = head.ResultName;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #3
0
        public string Import()
        {
            try
            {
                ControllerContext.HttpContext.Request.ContentEncoding = Encoding.GetEncoding("UTF-8");
                ControllerContext.HttpContext.Response.ContentEncoding = Encoding.GetEncoding("UTF-8");
                ControllerContext.HttpContext.Response.Charset = "UTF-8";
                var result = "";
                var basePath = Server.MapPath("~/UploadData/");
                if (Request.Files["Filedata"] != null)
                {
                    var myFile = Request.Files["Filedata"];
                    //HttpPostedFile myFile = Request.Files["Filedata"];

                    var filename = Guid.NewGuid() + ".xls";

                    int nFileLen = myFile.ContentLength;
                    byte[] myData = new byte[nFileLen];
                    myFile.InputStream.Read(myData, 0, nFileLen);
                    System.IO.FileStream newFile = new System.IO.FileStream(basePath + filename,
                        System.IO.FileMode.Create);
                    newFile.Write(myData, 0, myData.Length);
                    newFile.Close();
                    var exp = new ExportXls();
                    var dt = exp.ExcelToDataTable("", true, basePath + filename);
                     result = ClassRoomImport(dt,  filename);

                    System.IO.File.Delete(basePath + filename);
                }
                return result;
            }
            catch (Exception ex)
            {
                Log.Error("教室信息导入失败:" + ex.Message, ex);
                return "教室信息导入失败:" + ex.Message;
            }
        }
Example #4
0
        //导出数据
        public void DownloaddataTeacher()
        {
            var exXls = new ExportXls();
            var filename = "师资用车需求及车辆安排情况统计表.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("用车日期");
            fieldsNames.Add("出发时间");
            fieldsNames.Add("出发地点");
            fieldsNames.Add("到达地点");
            fieldsNames.Add("乘车人员");
            fieldsNames.Add("乘车人数");
            fieldsNames.Add("车型");
            fieldsNames.Add("车牌号");
            fieldsNames.Add("司机姓名");
            fieldsNames.Add("司机联系方式");
            fieldsNames.Add("段工作人员姓名");
            fieldsNames.Add("段工作人员联系方式");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("用车日期", typeof(string));
            dt.Columns.Add("出发时间", typeof(string));
            dt.Columns.Add("出发地点", typeof(string));
            dt.Columns.Add("到达地点", typeof(string));
            dt.Columns.Add("乘车人员", typeof(string));
            dt.Columns.Add("乘车人数", typeof(string));
            dt.Columns.Add("车型", typeof(string));
            dt.Columns.Add("车牌号", typeof(string));
            dt.Columns.Add("司机姓名", typeof(string));
            dt.Columns.Add("司机联系方式", typeof(string));
            dt.Columns.Add("段工作人员姓名", typeof(string));
            dt.Columns.Add("段工作人员联系方式", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<CarInfo, bool>> where = PredicateExtensionses.True<CarInfo>();
            if (!string.IsNullOrEmpty(Request["UseDate"]))
            {
                var useDate = Convert.ToDateTime(Request["UseDate"]);
                where = where.And(m => m.UseDate >= useDate);
            }
            if (!string.IsNullOrEmpty(Request["UseDateEnd"]))
            {
                var useDateEnd = Convert.ToDateTime(Request["UseDateEnd"]);
                where = where.And(m => m.UseDate <= useDateEnd);
            }
            if (!string.IsNullOrEmpty(Request["UseTime"]))
            {
                var useTime = Convert.ToDateTime(Request["UseTime"]);
                where = where.And(m => Convert.ToDateTime(m.UseTime) >= useTime);
            }
            if (!string.IsNullOrEmpty(Request["UseTimeEnd"]))
            {
                var useTimeEnd = Convert.ToDateTime(Request["UseTimeEnd"]);
                where = where.And(m => Convert.ToDateTime(m.UseTime) <= useTimeEnd);
            }
            if (!string.IsNullOrEmpty(Request["StartPlace"]))
            {
                var startPlace = Request["StartPlace"];
                where = where.And(m => m.StartPlace.Contains(startPlace));
            }
            if (!string.IsNullOrEmpty(Request["EndPlace"]))
            {
                var endPlace = Request["EndPlace"];
                where = where.And(m => m.EndPlace.Contains(endPlace));
            }
            if (!string.IsNullOrEmpty(Request["CarType"]))
            {
                var carType = Request["CarType"];
                where = where.And(m => m.CarType == carType);
            }
            if (!string.IsNullOrEmpty(Request["CarNo"]))
            {
                var carNo = Request["CarNo"];
                where = where.And(m => m.CarNo.Contains(carNo));
            }
            where.And(m => m.UsePersonType == 2);
            where.And(m => m.IsValid);

            var entitys = unitOfWork.CarInfoBLL.GetEntitys(where);
            if (entitys != null && entitys.Any())
            {
                foreach (var carinfo in entitys)
                {
                    var row = dt.NewRow();
                    row["用车日期"] = Convert.ToDateTime(carinfo.UseDate).ToString("yyyy-MM-dd");
                    row["出发时间"] = carinfo.UseTime;
                    row["出发地点"] = carinfo.StartPlace;
                    row["到达地点"] = carinfo.EndPlace;
                    row["乘车人员"] = carinfo.Passenger;
                    row["乘车人数"] = carinfo.PassengerNum;
                    row["车型"] = carinfo.CarTypeName;
                    row["车牌号"] = carinfo.CarNo;
                    row["司机姓名"] = carinfo.DriverName;
                    row["司机联系方式"] = carinfo.DriverTel;
                    row["段工作人员姓名"] = carinfo.WorkName;
                    row["段工作人员联系方式"] = carinfo.WorkTel;
                    row["备注"] = carinfo.Remark;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-实作考评信息统计表.xls";

            //岗位名称	岗位编号	班级名称	开班日期	结束日期
            //课程计划编号	实训项目编号	实训项目名称	实作指导书名称	实作指导书编号
            //实作考评表名称	实作考评表编号	评审情况	评审结果	审定日期	考评日期
            //课程计划链接	实作考评表链接	实作指导书链接	备注

            var fieldsNames = new List<string>();

            fieldsNames.Add("岗位名称");
            fieldsNames.Add("岗位编号");
            fieldsNames.Add("班级名称");
            fieldsNames.Add("开班日期");
            fieldsNames.Add("结束日期");
            fieldsNames.Add("课程计划编号");
            fieldsNames.Add("实训项目编号");
            fieldsNames.Add("实训项目名称");
            fieldsNames.Add("实作指导书名称");
            fieldsNames.Add("实作指导书编号");
            fieldsNames.Add("实作考评表名称");
            fieldsNames.Add("实作考评表编号");
            fieldsNames.Add("评审情况");
            fieldsNames.Add("评审结果");
            fieldsNames.Add("审定日期");
            fieldsNames.Add("考评日期");
            fieldsNames.Add("课程计划链接");
            fieldsNames.Add("实作考评表链接");
            fieldsNames.Add("实作指导书链接");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("岗位名称", typeof(string));
            dt.Columns.Add("岗位编号", typeof(string));
            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("开班日期", typeof(string));
            dt.Columns.Add("结束日期", typeof(string));
            dt.Columns.Add("课程计划编号", typeof(string));
            dt.Columns.Add("实训项目编号", typeof(string));
            dt.Columns.Add("实训项目名称", typeof(string));
            dt.Columns.Add("实作指导书名称", typeof(string));
            dt.Columns.Add("实作指导书编号", typeof(string));
            dt.Columns.Add("实作考评表名称", typeof(string));
            dt.Columns.Add("实作考评表编号", typeof(string));
            dt.Columns.Add("评审情况", typeof(string));
            dt.Columns.Add("评审结果", typeof(string));
            dt.Columns.Add("审定日期", typeof(string));
            dt.Columns.Add("考评日期", typeof(string));
            dt.Columns.Add("课程计划链接", typeof(string));
            dt.Columns.Add("实作考评表链接", typeof(string));
            dt.Columns.Add("实作指导书链接", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<ImpTeachPlanStatOne, bool>> where = PredicateExtensionses.True<ImpTeachPlanStatOne>();
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var className = Request["ClassName"];
                where = where.And(m => m.ClassName == className);
            }
            if (!string.IsNullOrEmpty(Request["PositionID"]))
            {
                var positionID = Request["PositionID"];
                where = where.And(m => m.PositionID == positionID);
            }
            if (!string.IsNullOrEmpty(Request["ProjectID"]))
            {
                var projectID = Request["ProjectID"];
                where = where.And(m => m.ProjectID == projectID);
            }
            if (!string.IsNullOrEmpty(Request["ImpExamineTableID"]))
            {
                var impExamineTableID = Request["ImpExamineTableID"];
                where = where.And(m => m.ImpExamineTableID == impExamineTableID);
            }
            if (!string.IsNullOrEmpty(Request["ImpInstructionBookID"]))
            {
                var impInstructionBookID = Request["ImpInstructionBookID"];
                where = where.And(m => m.ImpInstructionBookID == impInstructionBookID);
            }
            if (!string.IsNullOrEmpty(Request["CoursePlanID"]))
            {
                var coursePlanID = Request["CoursePlanID"];
                where = where.And(m => m.CoursePlanID == coursePlanID);
            }

            where = where.And(m => m.IsValid);

            var entitys = unitOfWork.ImpTeachPlanStatOneBLL.GetEntitys(where).OrderBy(m => m.ClassName);
            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();
                    row["岗位名称"] = entity.PositionName;
                    row["岗位编号"] = entity.PositionID;
                    row["班级名称"] = entity.ClassName;
                    row["开班日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ClassBeginDate);
                    row["结束日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ClassEndDate);
                    row["课程计划编号"] = entity.CoursePlanID;
                    row["实训项目编号"] = entity.ProjectID;
                    row["实训项目名称"] = entity.ProjectName;
                    row["实作指导书名称"] = entity.ImpInstructionBookName;
                    row["实作指导书编号"] = entity.ImpInstructionBookID;
                    row["实作考评表名称"] = entity.ImpExamineTableName;
                    row["实作考评表编号"] = entity.ImpExamineTableID;
                    row["评审情况"] = entity.ExamineSituation;
                    row["评审结果"] = entity.ExamineResult;
                    row["审定日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.CheckDate);
                    row["考评日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ExamineDate);
                    row["课程计划链接"] = entity.CoursePlanLink;
                    row["实作考评表链接"] = entity.ImpExamineTableLink;
                    row["实作指导书链接"] = entity.ImpInstructionBookLink;
                    row["备注"] = entity.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #6
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-实作考评项目分配信息.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("学员编号");
            fieldsNames.Add("姓名");
            fieldsNames.Add("身份证号");
            fieldsNames.Add("考评岗位");
            fieldsNames.Add("班级名称");
            fieldsNames.Add("所在站段");
            fieldsNames.Add("抽考项目");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("身份证号", typeof(string));
            dt.Columns.Add("考评岗位", typeof(string));
            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("所在站段", typeof(string));
            dt.Columns.Add("抽考项目", typeof(string));
            dt.AcceptChanges();

            Expression<Func<Implementation, bool>> where = PredicateExtensionses.True<Implementation>();

            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var Luju = Request["ClassName"];
                where = where.And(m => m.ClassName.Contains(Luju));
            }
            if (!string.IsNullOrEmpty(Request["Zhanduan"]))
            {
                var Zhanduan = Request["Zhanduan"];
                where = where.And(m => m.Zhanduan.Contains(Zhanduan));
            }
            if (!string.IsNullOrEmpty(Request["Subjects"]))
            {
                var subjects = Request["Subjects"];
                where = where.And(m => m.Subjects.Contains(subjects));
            }
            if (!string.IsNullOrEmpty(Request["StuName"]))
            {
                var StuName = Request["StuName"];
                where = where.And(m => m.StuName.Contains(StuName));
            }
            if (!string.IsNullOrEmpty(Request["StuNo"]))
            {
                var stuNo = Request["StuNo"];
                where = where.And(m => m.StuNo.Contains(stuNo));
            }

            where = where.And(m => m.IsValid);
            var entitys = unitOfWork.ImplementationBLL.GetEntitys(where).OrderBy(m => m.StuNo);

            if (entitys != null && entitys.Any())
            {
                foreach (var dist in entitys)
                {

                    //dt.Columns.Add("学员编号", typeof(string));
                    //dt.Columns.Add("姓名", typeof(string));
                    //dt.Columns.Add("性别", typeof(string));
                    //dt.Columns.Add("工作证号", typeof(string));
                    //dt.Columns.Add("身份证号", typeof(string));
                    //dt.Columns.Add("手机号", typeof(string));
                    //dt.Columns.Add("所在路局", typeof(string));
                    //dt.Columns.Add("所在站段", typeof(string));
                    //dt.Columns.Add("抽考项目", typeof(string));

                    var row = dt.NewRow();
                    row["学员编号"] = dist.StuNo;
                    row["姓名"] = dist.StuName;

                    //var entity = unitOfWork.StudentBLL.GetEntityByID(dist.StuId);
                    //if (entity != null)
                    //{
                    //    row["性别"] = entity.GenderName;
                    //    row["工作证号"] = entity.WorkIdNo;
                    //    row["身份证号"] = entity.IdNo;
                    //    row["手机号"] = entity.CellPhoneNo;
                    //}

                    row["身份证号"] = dist.IdNo;
                    row["考评岗位"] = dist.ExaminePosition;

                    row["班级名称"] = dist.ClassName;
                    row["所在站段"] = dist.Zhanduan;
                    row["抽考项目"] = dist.Subjects;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-师资考评成绩统计.xls";

            //培训开始时间	培训结束时间	应到人数	实到人数	考核人数
            //合格	不合格	优秀	优秀比例	备注
            var fieldsNames = new List<string>();
            fieldsNames.Add("培训开始时间");
            fieldsNames.Add("培训结束时间");
            fieldsNames.Add("应到人数");
            fieldsNames.Add("实到人数");
            fieldsNames.Add("考核人数");
            fieldsNames.Add("合格");
            fieldsNames.Add("不合格");
            fieldsNames.Add("优秀");
            fieldsNames.Add("优秀比例");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("培训开始时间", typeof(string));
            dt.Columns.Add("培训结束时间", typeof(string));
            dt.Columns.Add("应到人数", typeof(string));
            dt.Columns.Add("实到人数", typeof(string));
            dt.Columns.Add("考核人数", typeof(string));
            dt.Columns.Add("合格", typeof(string));
            dt.Columns.Add("不合格", typeof(string));
            dt.Columns.Add("优秀", typeof(string));
            dt.Columns.Add("优秀比例", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<TeacherEvaluateScoreStat, bool>> where = PredicateExtensionses.True<TeacherEvaluateScoreStat>();
            if (!string.IsNullOrEmpty(Request["TrainBeginDate"]))
            {
                var trainBeginDate = Convert.ToDateTime(Request["TrainBeginDate"]);
                where = where.And(m => m.TrainBeginDate >= trainBeginDate);
            }
            if (!string.IsNullOrEmpty(Request["TrainEndDate"]))
            {
                var trainEndDate = Convert.ToDateTime(Request["TrainEndDate"]);
                where = where.And(m => m.TrainEndDate <= trainEndDate);
            }

            where = where.And(m => m.IsValid);

            var entitys = unitOfWork.TeacherEvaluateScoreStatBLL.GetEntitys(where).OrderBy(m=>m.TrainBeginDate);
            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();
                    row["培训开始时间"] = ConvertUtil.ConvertNullableDatetimeToString(entity.TrainBeginDate);
                    row["培训结束时间"] = ConvertUtil.ConvertNullableDatetimeToString(entity.TrainEndDate);
                    row["应到人数"] = ConvertUtil.ConvertNullableIntToString(entity.PlanNum);
                    row["实到人数"] = ConvertUtil.ConvertNullableIntToString(entity.ActualNum);
                    row["考核人数"] = ConvertUtil.ConvertNullableIntToString(entity.ExamineNum);
                    row["合格"] = ConvertUtil.ConvertNullableIntToString(entity.PassNum);
                    row["不合格"] = ConvertUtil.ConvertNullableIntToString(entity.FailNum);
                    row["优秀"] = ConvertUtil.ConvertNullableIntToString(entity.ExcellentNum);
                    row["优秀比例"] = entity.ExcellentRate;
                    row["备注"] = entity.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #8
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-课程信息.xls";

            // 		教研室	课程名称	备注

            var fieldsNames = new List<string>();
            fieldsNames.Add("教研室");
            fieldsNames.Add("课程名称");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("教研室", typeof (string));
            dt.Columns.Add("课程名称", typeof (string));
            dt.Columns.Add("备注", typeof (string));
            dt.AcceptChanges();

            var entitys = unitOfWork.CourseInfoBLL.GetEntitys(m=>m.IsValid);
            if (entitys != null && entitys.Any())
            {
                foreach (var mode in entitys)
                {
                    var row = dt.NewRow();
                    row["教研室"] = mode.OrgName;
                    row["课程名称"] = mode.Name;
                    row["备注"] = mode.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #9
0
        public string Import()
        {
            ControllerContext.HttpContext.Request.ContentEncoding = Encoding.GetEncoding("UTF-8");
            ControllerContext.HttpContext.Response.ContentEncoding = Encoding.GetEncoding("UTF-8");
            ControllerContext.HttpContext.Response.Charset = "UTF-8";

            var basePath = Server.MapPath("~/UploadData/");
            if (Request.Files["Filedata"] != null)
            {
                var myFile = Request.Files["Filedata"];
                //HttpPostedFile myFile = Request.Files["Filedata"];

                var filename = Guid.NewGuid() + ".xls";

                int nFileLen = myFile.ContentLength;
                byte[] myData = new byte[nFileLen];
                myFile.InputStream.Read(myData, 0, nFileLen);
                System.IO.FileStream newFile = new System.IO.FileStream(basePath + filename, System.IO.FileMode.Create);
                newFile.Write(myData, 0, myData.Length);
                newFile.Close();
                var exp = new ExportXls();
                var dt = exp.ExcelToDataTable("", true, basePath + filename);
                var msg = "";
                var result = TeacherImport(dt, out msg, filename);

               // System.IO.File.Delete(basePath + filename);
            }

            return "";
        }
Example #10
0
        public void DownloadModeldata()
        {
            var exXls = new ExportXls();
            var filename = "课表信息.xls";

            Expression<Func<SchedulingModel, bool>> where = PredicateExtensionses.True<SchedulingModel>();

            if (!string.IsNullOrEmpty(Request["OrgId"]))
            {
                var orgId = Request["OrgId"];
                where = where.And(m => m.OrgId.Equals(orgId));
            }
            if (!string.IsNullOrEmpty(Request["TeacherNames"]))
            {
                var teacherNames = Request["TeacherNames"];
                where = where.And(m => m.TeacherNames.Contains(teacherNames));
            }
            if (!string.IsNullOrEmpty(Request["Classroom"]))
            {
                var classroom = Request["Classroom"];
                where = where.And(m => m.ClassRoomNo.Contains(classroom));
            }

            where.And(m => m.IsValid);

              //  天数	时间	科目	课时	培训师	教室	教研室

            var fieldsNames = new List<string>();
            fieldsNames.Add("天数");
            fieldsNames.Add("时间");
            fieldsNames.Add("科目");
            fieldsNames.Add("课时");
            fieldsNames.Add("培训师");
            fieldsNames.Add("教室");
            fieldsNames.Add("教研室");

            var ds = new DataSet();
            var dt = new DataTable();
            dt.Columns.Add("天数", typeof(string));
            dt.Columns.Add("时间", typeof(string));
            dt.Columns.Add("科目", typeof(string));
            dt.Columns.Add("课时", typeof(string));
            dt.Columns.Add("培训师", typeof(string));
            dt.Columns.Add("教室", typeof (string));
            dt.Columns.Add("教研室", typeof(string));
            dt.AcceptChanges();

            var entitys = unitOfWork.SchedulingModelBLL.GetEntitys(where);

            if (entitys != null && entitys.Any())
            {
                foreach (var schedulingModel in entitys)
                {
                    var row = dt.NewRow();
                    row["天数"] = schedulingModel.TheDay;
                    row["时间"] = schedulingModel.ClassTime;
                    row["科目"] = schedulingModel.CourseName;
                    row["课时"] = schedulingModel.UseTime;
                    row["培训师"] = schedulingModel.TeacherNames;
                    row["教室"] = schedulingModel.ClassRoomNo;
                    row["教研室"] = schedulingModel.OrgName;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #11
0
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-认证部反馈实作基本表1.xls";

            //抽考项目	考评日期	建议考评日期(从课程计划表中抓取,)	实训项目编号
            //实训项目名称	实训教案编号	实训教案名称	实训教案挂网时间	实训教案评审时间
            //实训教案评审结果	实作考核评分表编号	实作考核评分表名称	实作考核评分表挂网时间
            //考核时段	考核项目编号	考核项目名称	学员签认	监考员	考评员1	考评员2
            //考试起始时间	考试结束时间	时长	成绩	考核项目成绩性质	考核项目是否合格
            //是否补考		补考成绩	总时长	总成绩	考核结果	参加实作考核人数	一次通过率	合格人数	不合格人数	合格率(%)	备注
            var fieldsNames = new List<string>();
            fieldsNames.Add("抽考项目");
            fieldsNames.Add("考评日期");
            fieldsNames.Add("建议考评日期");
            fieldsNames.Add("实训项目编号");
            fieldsNames.Add("实训项目名称");
            fieldsNames.Add("实训教案编号");
            fieldsNames.Add("实训教案名称");
            fieldsNames.Add("实训教案挂网时间");
            fieldsNames.Add("实训教案评审时间");
            fieldsNames.Add("实训教案评审结果");
            fieldsNames.Add("实作考核评分表编号");
            fieldsNames.Add("实作考核评分表名称");
            fieldsNames.Add("实作考核评分表挂网时间");
            fieldsNames.Add("考核时段");
            fieldsNames.Add("考核项目编号");
            fieldsNames.Add("考核项目名称");
            fieldsNames.Add("学员签认");
            fieldsNames.Add("监考员");
            fieldsNames.Add("考评员1");
            fieldsNames.Add("考评员2");
            fieldsNames.Add("考试起始时间");
            fieldsNames.Add("考试结束时间");
            fieldsNames.Add("时长");
            fieldsNames.Add("成绩");
            fieldsNames.Add("考核项目成绩性质");
            fieldsNames.Add("考核项目是否合格");
            fieldsNames.Add("是否补考");
            fieldsNames.Add("补考成绩");
            fieldsNames.Add("总时长");
            fieldsNames.Add("总成绩");
            fieldsNames.Add("考核结果");
            fieldsNames.Add("参加实作考核人数");
            fieldsNames.Add("一次通过率");
            fieldsNames.Add("合格人数");
            fieldsNames.Add("不合格人数");
            fieldsNames.Add("合格率");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("抽考项目", typeof(string));
            dt.Columns.Add("考评日期", typeof(string));
            dt.Columns.Add("建议考评日期", typeof(string));
            dt.Columns.Add("实训项目编号", typeof(string));
            dt.Columns.Add("实训项目名称", typeof(string));
            dt.Columns.Add("实训教案编号", typeof(string));
            dt.Columns.Add("实训教案名称", typeof(string));
            dt.Columns.Add("实训教案挂网时间", typeof(string));
            dt.Columns.Add("实训教案评审时间", typeof(string));
            dt.Columns.Add("实训教案评审结果", typeof(string));
            dt.Columns.Add("实作考核评分表编号", typeof(string));
            dt.Columns.Add("实作考核评分表名称", typeof(string));
            dt.Columns.Add("实作考核评分表挂网时间", typeof(string));
            dt.Columns.Add("考核时段", typeof(string));
            dt.Columns.Add("考核项目编号", typeof(string));
            dt.Columns.Add("考核项目名称", typeof(string));
            dt.Columns.Add("学员签认", typeof(string));
            dt.Columns.Add("监考员", typeof(string));
            dt.Columns.Add("考评员1", typeof(string));
            dt.Columns.Add("考评员2", typeof(string));
            dt.Columns.Add("考试起始时间", typeof(string));
            dt.Columns.Add("考试结束时间", typeof(string));
            dt.Columns.Add("时长", typeof(string));
            dt.Columns.Add("成绩", typeof(string));
            dt.Columns.Add("考核项目成绩性质", typeof(string));
            dt.Columns.Add("考核项目是否合格", typeof(string));
            dt.Columns.Add("是否补考", typeof(string));
            dt.Columns.Add("补考成绩", typeof(string));
            dt.Columns.Add("总时长", typeof(string));
            dt.Columns.Add("总成绩", typeof(string));
            dt.Columns.Add("考核结果", typeof(string));
            dt.Columns.Add("参加实作考核人数", typeof(string));
            dt.Columns.Add("一次通过率", typeof(string));
            dt.Columns.Add("合格人数", typeof(string));
            dt.Columns.Add("不合格人数", typeof(string));
            dt.Columns.Add("合格率", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<ImpBasicOne, bool>> where = PredicateExtensionses.True<ImpBasicOne>();
            DateTime examineDate;
            if (!string.IsNullOrEmpty(Request["ExamineDate"]))
            {
                if (DateTime.TryParse(Request["ExamineDate"], out examineDate))
                {
                    where = where.And(m => m.ExamineDate == examineDate);
                }
            }
            if (!string.IsNullOrEmpty(Request["ProjectID"]))
            {
                var projectID = Request["ProjectID"];
                where = where.And(m => m.ProjectID == projectID);
            }
            if (!string.IsNullOrEmpty(Request["ProjectName"]))
            {
                var projectName = Request["ProjectName"];
                where = where.And(m => m.ProjectName == projectName);
            }
            if (!string.IsNullOrEmpty(Request["ExamineProjectID"]))
            {
                var examineProjectID = Request["ExamineProjectID"];
                where = where.And(m => m.ExamineProjectID == examineProjectID);
            }
            if (!string.IsNullOrEmpty(Request["ExamineProjectName"]))
            {
                var examineProjectName = Request["ExamineProjectName"];
                where = where.And(m => m.ExamineProjectName == examineProjectName);
            }

            where = where.And(m => m.IsValid);

            var entitys = unitOfWork.ImpBasicOneBLL.GetEntitys(where).OrderBy(m => m.ExamineDate);
            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();

                    row["抽考项目"] = entity.ExamineProject;
                    row["考评日期"] = entity.ExamineDate;
                    row["建议考评日期"] = entity.SuggestExamineDate;
                    row["实训项目编号"] = entity.ProjectID;
                    row["实训项目名称"] = entity.ProjectName;
                    row["实训教案编号"] = entity.TeachPlanID;
                    row["实训教案名称"] = entity.TeachPlanName;
                    row["实训教案挂网时间"] = entity.TeachPlanOnlineDate;
                    row["实训教案评审时间"] = entity.TeachPlanEvaluateDate;
                    row["实训教案评审结果"] = entity.TeachPlanEvaluateResult;
                    row["实作考核评分表编号"] = entity.ExamineRateID;
                    row["实作考核评分表名称"] = entity.ExamineRateName;
                    row["实作考核评分表挂网时间"] = entity.ExamineRateOnlinDate;
                    row["考核时段"] = entity.ExaminePeriod;
                    row["考核项目编号"] = entity.ExamineProjectID;
                    row["考核项目名称"] = entity.ExamineProjectName;
                    row["学员签认"] = entity.Signed;
                    row["监考员"] = entity.Invigilator;
                    row["考评员1"] = entity.AssessorOne;
                    row["考评员2"] = entity.AssessorTwo;
                    row["考试起始时间"] = entity.ExamineStartTime;
                    row["考试结束时间"] = entity.ExamineEndTime;
                    row["时长"] = entity.ExamineTimeOffset;
                    row["成绩"] = entity.Score;
                    row["考核项目成绩性质"] = entity.ExamineScoreType;
                    row["考核项目是否合格"] = entity.Passed;
                    row["是否补考"] = entity.MakeUp;
                    row["补考成绩"] = entity.MakeUpScore;
                    row["总时长"] = entity.TotalTimeOffset;
                    row["总成绩"] = entity.TotalScore;
                    row["考核结果"] = entity.ExamineResult;
                    row["参加实作考核人数"] = entity.ImpExamineNum;
                    row["一次通过率"] = entity.OneTimeRate;
                    row["合格人数"] = entity.QualifiedNum;
                    row["不合格人数"] = entity.UnqualifiedNum;
                    row["合格率"] = entity.QualifiedRate;
                    row["备注"] = entity.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #12
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = "课表信息.xls";

            Expression<Func<SchedulingDetail, bool>> where1 = PredicateExtensionses.True<SchedulingDetail>();

            if (!string.IsNullOrEmpty(Request["id"]))
            {
                var id = Guid.Parse(Request["id"]);
                where1 = where1.And(m => m.ParentId == id);
            }
            where1.And(m => m.IsValid);

            var fieldsNames = new List<string>();
            fieldsNames.Add("培训班名称");
              //  fieldsNames.Add("岗位");
            fieldsNames.Add("班级编号");
            fieldsNames.Add("班主任");
            fieldsNames.Add("日期");
            fieldsNames.Add("星期");
            fieldsNames.Add("时间");
            fieldsNames.Add("科目");
            fieldsNames.Add("教室");
            fieldsNames.Add("培训师");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("培训班名称", typeof(string));
             //   dt.Columns.Add("岗位", typeof(string));
            dt.Columns.Add("班级编号", typeof(string));
            dt.Columns.Add("班主任", typeof(string));
            dt.Columns.Add("日期", typeof(string));
            dt.Columns.Add("星期", typeof(string));
            dt.Columns.Add("时间", typeof(string));
            dt.Columns.Add("科目", typeof(string));
            dt.Columns.Add("教室", typeof(string));
            dt.Columns.Add("培训师", typeof(string));
            dt.AcceptChanges();

            var entitys = unitOfWork.SchedulingDetailBLL.GetEntitys(where1, m => m.OrderBy(c=>c.ClassNo).ThenBy(c=>c.ShowOrder));

            if (entitys != null && entitys.Any())
            {
                foreach (var classinfo in entitys)
                {
                    var row = dt.NewRow();
                    var planinfo = unitOfWork.SchedulingPlanBLL.GetEntityByID(classinfo.ParentId);
                    row["培训班名称"] = planinfo.Name;
                   // row["岗位"] = planinfo.PostName;
                    row["班级编号"] = classinfo.ClassNo;
                    row["班主任"] = classinfo.HeadmasterName;
                    row["日期"] = classinfo.ClassDate.ToString("yyyy-MM-dd");
                    row["星期"] = classinfo.WeekInfo;
                    row["时间"] = classinfo.ClassTime;
                    row["科目"] = classinfo.CourseName;
                    row["教室"] = classinfo.ClassRoomNo;
                    row["培训师"] = classinfo.TeacherNames;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #13
0
        public void DownloadClassdata()
        {
            var exXls = new ExportXls();
            var filename = "课表信息.xls";

            Expression<Func<SchedulingPlan, bool>> where = PredicateExtensionses.True<SchedulingPlan>();
            Expression<Func<SchedulingDetail, bool>> where1 = PredicateExtensionses.True<SchedulingDetail>();

            if (!string.IsNullOrEmpty(Request["t"]))
            {
                if (Request["t"] == "q") //查询
                {
                    if (!string.IsNullOrEmpty(Request["Name"]))
                    {
                        var name = Request["Name"];
                        where = where.And(m => m.Name.Contains(name));
                    }
                    if (!string.IsNullOrEmpty(Request["PlanYear"]))
                    {
                        var planYear = Request["PlanYear"];
                        where = where.And(m => m.PlanYear == planYear);
                    }
                    if (!string.IsNullOrEmpty(Request["PeriodsNo"]))
                    {
                        var PeriodsNo = Request["PeriodsNo"];
                        where = where.And(m => m.PeriodsNo.Contains(PeriodsNo));
                    }
                    if (!string.IsNullOrEmpty(Request["OrgName"]))
                    {
                        var OrgName = Request["OrgName"];
                        where = where.And(m => m.OrgName.Contains(OrgName));
                    }
                    if (!string.IsNullOrEmpty(Request["PostName"]))
                    {
                        var PostName = Request["PostName"];
                        where = where.And(m => m.PostName.Contains(PostName));
                    }
                    if (!string.IsNullOrEmpty(Request["Trainer"]))
                    {
                        var trainer = Request["Trainer"];
                        where1 = where1.And(m => m.TeacherNames.Contains(trainer));
                    }
                    if (!string.IsNullOrEmpty(Request["Classroom"]))
                    {
                        var classroom = Request["Classroom"];
                        where1 = where1.And(m => m.ClassRoomNo.Contains(classroom));
                    }
                }
            }

            where1.And(m => m.IsValid);
            where.And(m => m.IsValid);

            var fieldsNames = new List<string>();
            fieldsNames.Add("日期");
            fieldsNames.Add("星期");
            fieldsNames.Add("时间");
            fieldsNames.Add("培训班名称");
            fieldsNames.Add("班级编号");
            fieldsNames.Add("班主任");
            fieldsNames.Add("科目");
            fieldsNames.Add("培训师");
            fieldsNames.Add("课时");
            fieldsNames.Add("教室");

             //   日 期	星 期	时 间	班级	班主任	科 目	课时	教师	教室

            var ds = new DataSet();
            var dt = new DataTable();
            dt.Columns.Add("日期", typeof(string));
            dt.Columns.Add("星期", typeof(string));
            dt.Columns.Add("时间", typeof(string));
            dt.Columns.Add("培训班名称", typeof (string));
            dt.Columns.Add("班级编号", typeof(string));
            dt.Columns.Add("班主任", typeof(string));
            dt.Columns.Add("科目", typeof(string));
            dt.Columns.Add("培训师", typeof(string));
            dt.Columns.Add("课时", typeof(string));
            dt.Columns.Add("教室", typeof (string));
            dt.AcceptChanges();

            var entitys = unitOfWork.SchedulingDetailBLL.GetEntitys(where1, m => m.OrderBy(c => c.ClassDate).ThenBy(c => c.ParentName));
            var entitysParent = unitOfWork.SchedulingPlanBLL.GetEntitys(where);

            if (entitys != null && entitys.Any())
            {
                foreach (var classinfo in entitys)
                {
                    foreach (var schedulingPlan in entitysParent)
                    {
                        if (classinfo.ParentId == schedulingPlan.Id)
                        {
                            var row = dt.NewRow();
                            var planinfo = unitOfWork.SchedulingPlanBLL.GetEntityByID(classinfo.ParentId);
                            row["日期"] = Convert.ToDateTime(classinfo.ClassDate).ToString("yyyy-MM-dd");
                            row["星期"] = classinfo.WeekInfo;
                            row["时间"] = classinfo.ClassTime;
                            row["培训班名称"] = planinfo.Name;
                            row["班级编号"] = classinfo.ClassNo;
                            row["班主任"] = classinfo.HeadmasterName;
                            row["科目"] = classinfo.CourseName;
                            row["培训师"] = classinfo.TeacherNames;
                            row["课时"] = classinfo.UseTime;
                            row["教室"] = classinfo.ClassRoomNo;
                            dt.Rows.Add(row);
                            dt.AcceptChanges();
                        }
                    }
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #14
0
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-培训通过率报表.xls";

            //收报时间	电报号	岗位名称	培训班性质	班级名称	班主任
            //开班日期	结束日期	参培人数	考试人数	安全补考人数
            //理论补考人数	实作补考人数	一次通过人数	一次通过率	补考不合格人数
            //培训合格率	优秀人数	优秀率	备注

            var fieldsNames = new List<string>();
            fieldsNames.Add("收报时间");
            fieldsNames.Add("电报号");
            fieldsNames.Add("岗位名称");
            fieldsNames.Add("培训班性质");
            fieldsNames.Add("班级名称");
            fieldsNames.Add("班主任");
            fieldsNames.Add("开班日期");
            fieldsNames.Add("结束日期");
            fieldsNames.Add("参培人数");
            fieldsNames.Add("考试人数");
            fieldsNames.Add("安全补考人数");
            fieldsNames.Add("理论补考人数");
            fieldsNames.Add("实作补考人数");
            fieldsNames.Add("一次通过人数");
            fieldsNames.Add("一次通过率");
            fieldsNames.Add("补考不合格人数");
            fieldsNames.Add("培训合格率");
            fieldsNames.Add("优秀人数");
            fieldsNames.Add("优秀率");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("收报时间", typeof(string));
            dt.Columns.Add("电报号", typeof(string));
            dt.Columns.Add("岗位名称", typeof(string));
            dt.Columns.Add("培训班性质", typeof(string));
            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("班主任", typeof(string));
            dt.Columns.Add("开班日期", typeof(string));
            dt.Columns.Add("结束日期", typeof(string));
            dt.Columns.Add("参培人数", typeof(string));
            dt.Columns.Add("考试人数", typeof(string));
            dt.Columns.Add("安全补考人数", typeof(string));
            dt.Columns.Add("理论补考人数", typeof(string));
            dt.Columns.Add("实作补考人数", typeof(string));
            dt.Columns.Add("一次通过人数", typeof(string));
            dt.Columns.Add("一次通过率", typeof(string));
            dt.Columns.Add("补考不合格人数", typeof(string));
            dt.Columns.Add("培训合格率", typeof(string));
            dt.Columns.Add("优秀人数", typeof(string));
            dt.Columns.Add("优秀率", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<ExamineStat, bool>> where = PredicateExtensionses.True<ExamineStat>();

            if (!string.IsNullOrEmpty(Request["TrainPostion"]))
            {
                var trainPostion = Request["TrainPostion"];
                where = where.And(m => m.TrainPostion == trainPostion);
            }
            if (!string.IsNullOrEmpty(Request["TrainType"]))
            {
                var trainType = Request["TrainType"];
                where = where.And(m => m.TrainType == trainType);
            }
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var className = Request["ClassName"];
                where = where.And(m => m.ClassName == className);
            }
            if (!string.IsNullOrEmpty(Request["ClassTeacher"]))
            {
                var classTeacher = Request["ClassTeacher"];
                where = where.And(m => m.ClassTeacher == classTeacher);
            }

            where = where.And(m => m.IsValid);

            var entitys = unitOfWork.ExamineStatBLL.GetEntitys(where).OrderBy(m => m.ClassName);
            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();
                    row["收报时间"] = ConvertUtil.ConvertNullableDatetimeToString(entity.TelegraphReceiveDate);
                    row["电报号"] = entity.TelegraphNO;
                    row["岗位名称"] = entity.TrainPostion;
                    row["培训班性质"] = entity.TrainType;
                    row["班级名称"] = entity.ClassName;
                    row["班主任"] = entity.ClassTeacher;
                    row["开班日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ClassBeginDate);
                    row["结束日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ClassEndDate);
                    row["参培人数"] = ConvertUtil.ConvertNullableIntToString(entity.TrainerNum);
                    row["考试人数"] = ConvertUtil.ConvertNullableIntToString(entity.ExamineNum);
                    row["安全补考人数"] = ConvertUtil.ConvertNullableIntToString(entity.SecurityMakeupNum);
                    row["理论补考人数"] = ConvertUtil.ConvertNullableIntToString(entity.TheoryMakeupNum);
                    row["实作补考人数"] = ConvertUtil.ConvertNullableIntToString(entity.ImpMakeupNum);
                    row["一次通过人数"] = ConvertUtil.ConvertNullableIntToString(entity.OneTimePassNum);
                    row["一次通过率"] = entity.OneTimePassRate;
                    row["补考不合格人数"] = ConvertUtil.ConvertNullableIntToString(entity.MakeupFailNum);
                    row["培训合格率"] = entity.PassRate;
                    row["优秀人数"] = ConvertUtil.ConvertNullableIntToString(entity.ExcellentNum);
                    row["优秀率"] = entity.ExcellentRate;
                    row["备注"] = entity.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #15
0
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-认证部反馈实作基本表1.xls";

            //发报时间	收报时间	电报号	电报名称	培训岗位	培训班性质	班级名称
            //开班日期	结束日期	班主任	教室	学员编号	姓名	性别	所在路局	所在站段
            //身份证号	工作证号	手机号	抽考项目	考评日期	监考员
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //考核项目编号	考核项目名称	考试起始时间	考试结束时间	考评员1	考评员2	时长	成绩
            //总用时	总成绩	补考项目	补考次数	是否合格

            var fieldsNames = new List<string>();
            fieldsNames.Add("发报时间");
            fieldsNames.Add("收报时间");
            fieldsNames.Add("电报号");
            fieldsNames.Add("电报名称");
            fieldsNames.Add("培训岗位");
            fieldsNames.Add("培训班性质");
            fieldsNames.Add("班级名称");
            fieldsNames.Add("开班日期");
            fieldsNames.Add("结束日期");
            fieldsNames.Add("班主任");
            fieldsNames.Add("教室");
            fieldsNames.Add("学员编号");
            fieldsNames.Add("姓名");
            fieldsNames.Add("性别");
            fieldsNames.Add("所在路局");
            fieldsNames.Add("所在站段");
            fieldsNames.Add("身份证号");
            fieldsNames.Add("工作证号");
            fieldsNames.Add("手机号");
            fieldsNames.Add("抽考项目");
            fieldsNames.Add("考评日期");
            fieldsNames.Add("监考员");
            fieldsNames.Add("考核项目编号(一)");
            fieldsNames.Add("考核项目名称(一)");
            fieldsNames.Add("考试起始时间(一)");
            fieldsNames.Add("考试结束时间(一)");
            fieldsNames.Add("考评员1(一)");
            fieldsNames.Add("考评员2(一)");
            fieldsNames.Add("时长(一)");
            fieldsNames.Add("成绩(一)");
            fieldsNames.Add("考核项目编号(二)");
            fieldsNames.Add("考核项目名称(二)");
            fieldsNames.Add("考试起始时间(二)");
            fieldsNames.Add("考试结束时间(二)");
            fieldsNames.Add("考评员1(二)");
            fieldsNames.Add("考评员2(二)");
            fieldsNames.Add("时长(二)");
            fieldsNames.Add("成绩(二)");
            fieldsNames.Add("考核项目编号(三)");
            fieldsNames.Add("考核项目名称(三)");
            fieldsNames.Add("考试起始时间(三)");
            fieldsNames.Add("考试结束时间(三)");
            fieldsNames.Add("考评员1(三)");
            fieldsNames.Add("考评员2(三)");
            fieldsNames.Add("时长(三)");
            fieldsNames.Add("成绩(三)");
            fieldsNames.Add("考核项目编号(四)");
            fieldsNames.Add("考核项目名称(四)");
            fieldsNames.Add("考试起始时间(四)");
            fieldsNames.Add("考试结束时间(四)");
            fieldsNames.Add("考评员1(四)");
            fieldsNames.Add("考评员2(四)");
            fieldsNames.Add("时长(四)");
            fieldsNames.Add("成绩(四)");
            fieldsNames.Add("考核项目编号(五)");
            fieldsNames.Add("考核项目名称(五)");
            fieldsNames.Add("考试起始时间(五)");
            fieldsNames.Add("考试结束时间(五)");
            fieldsNames.Add("考评员1(五)");
            fieldsNames.Add("考评员2(五)");
            fieldsNames.Add("时长(五)");
            fieldsNames.Add("成绩(五)");
            fieldsNames.Add("考核项目编号(六)");
            fieldsNames.Add("考核项目名称(六)");
            fieldsNames.Add("考试起始时间(六)");
            fieldsNames.Add("考试结束时间(六)");
            fieldsNames.Add("考评员1(六)");
            fieldsNames.Add("考评员2(六)");
            fieldsNames.Add("时长(六)");
            fieldsNames.Add("成绩(六)");
            fieldsNames.Add("考核项目编号(七)");
            fieldsNames.Add("考核项目名称(七)");
            fieldsNames.Add("考试起始时间(七)");
            fieldsNames.Add("考试结束时间(七)");
            fieldsNames.Add("考评员1(七)");
            fieldsNames.Add("考评员2(七)");
            fieldsNames.Add("时长(七)");
            fieldsNames.Add("成绩(七)");
            fieldsNames.Add("考核项目编号(八)");
            fieldsNames.Add("考核项目名称(八)");
            fieldsNames.Add("考试起始时间(八)");
            fieldsNames.Add("考试结束时间(八)");
            fieldsNames.Add("考评员1(八)");
            fieldsNames.Add("考评员2(八)");
            fieldsNames.Add("时长(八)");
            fieldsNames.Add("成绩(八)");
            fieldsNames.Add("考核项目编号(九)");
            fieldsNames.Add("考核项目名称(九)");
            fieldsNames.Add("考试起始时间(九)");
            fieldsNames.Add("考试结束时间(九)");
            fieldsNames.Add("考评员1(九)");
            fieldsNames.Add("考评员2(九)");
            fieldsNames.Add("时长(九)");
            fieldsNames.Add("成绩(九)");
            fieldsNames.Add("考核项目编号(十)");
            fieldsNames.Add("考核项目名称(十)");
            fieldsNames.Add("考试起始时间(十)");
            fieldsNames.Add("考试结束时间(十)");
            fieldsNames.Add("考评员1(十)");
            fieldsNames.Add("考评员2(十)");
            fieldsNames.Add("时长(十)");
            fieldsNames.Add("成绩(十)");
            fieldsNames.Add("总用时");
            fieldsNames.Add("总成绩");
            fieldsNames.Add("补考项目");
            fieldsNames.Add("补考次数");
            fieldsNames.Add("是否合格");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("发报时间", typeof(string));
            dt.Columns.Add("收报时间", typeof(string));
            dt.Columns.Add("电报号", typeof(string));
            dt.Columns.Add("电报名称", typeof(string));
            dt.Columns.Add("培训岗位", typeof(string));
            dt.Columns.Add("培训班性质", typeof(string));
            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("开班日期", typeof(string));
            dt.Columns.Add("结束日期", typeof(string));
            dt.Columns.Add("班主任", typeof(string));
            dt.Columns.Add("教室", typeof(string));
            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("性别", typeof(string));
            dt.Columns.Add("所在路局", typeof(string));
            dt.Columns.Add("所在站段", typeof(string));
            dt.Columns.Add("身份证号", typeof(string));
            dt.Columns.Add("工作证号", typeof(string));
            dt.Columns.Add("手机号", typeof(string));
            dt.Columns.Add("抽考项目", typeof(string));
            dt.Columns.Add("考评日期", typeof(string));
            dt.Columns.Add("监考员", typeof(string));
            dt.Columns.Add("考核项目编号(一)", typeof(string));
            dt.Columns.Add("考核项目名称(一)", typeof(string));
            dt.Columns.Add("考试起始时间(一)", typeof(string));
            dt.Columns.Add("考试结束时间(一)", typeof(string));
            dt.Columns.Add("考评员1(一)", typeof(string));
            dt.Columns.Add("考评员2(一)", typeof(string));
            dt.Columns.Add("时长(一)", typeof(string));
            dt.Columns.Add("成绩(一)", typeof(string));
            dt.Columns.Add("考核项目编号(二)", typeof(string));
            dt.Columns.Add("考核项目名称(二)", typeof(string));
            dt.Columns.Add("考试起始时间(二)", typeof(string));
            dt.Columns.Add("考试结束时间(二)", typeof(string));
            dt.Columns.Add("考评员1(二)", typeof(string));
            dt.Columns.Add("考评员2(二)", typeof(string));
            dt.Columns.Add("时长(二)", typeof(string));
            dt.Columns.Add("成绩(二)", typeof(string));
            dt.Columns.Add("考核项目编号(三)", typeof(string));
            dt.Columns.Add("考核项目名称(三)", typeof(string));
            dt.Columns.Add("考试起始时间(三)", typeof(string));
            dt.Columns.Add("考试结束时间(三)", typeof(string));
            dt.Columns.Add("考评员1(三)", typeof(string));
            dt.Columns.Add("考评员2(三)", typeof(string));
            dt.Columns.Add("时长(三)", typeof(string));
            dt.Columns.Add("成绩(三)", typeof(string));
            dt.Columns.Add("考核项目编号(四)", typeof(string));
            dt.Columns.Add("考核项目名称(四)", typeof(string));
            dt.Columns.Add("考试起始时间(四)", typeof(string));
            dt.Columns.Add("考试结束时间(四)", typeof(string));
            dt.Columns.Add("考评员1(四)", typeof(string));
            dt.Columns.Add("考评员2(四)", typeof(string));
            dt.Columns.Add("时长(四)", typeof(string));
            dt.Columns.Add("成绩(四)", typeof(string));
            dt.Columns.Add("考核项目编号(五)", typeof(string));
            dt.Columns.Add("考核项目名称(五)", typeof(string));
            dt.Columns.Add("考试起始时间(五)", typeof(string));
            dt.Columns.Add("考试结束时间(五)", typeof(string));
            dt.Columns.Add("考评员1(五)", typeof(string));
            dt.Columns.Add("考评员2(五)", typeof(string));
            dt.Columns.Add("时长(五)", typeof(string));
            dt.Columns.Add("成绩(五)", typeof(string));
            dt.Columns.Add("考核项目编号(六)", typeof(string));
            dt.Columns.Add("考核项目名称(六)", typeof(string));
            dt.Columns.Add("考试起始时间(六)", typeof(string));
            dt.Columns.Add("考试结束时间(六)", typeof(string));
            dt.Columns.Add("考评员1(六)", typeof(string));
            dt.Columns.Add("考评员2(六)", typeof(string));
            dt.Columns.Add("时长(六)", typeof(string));
            dt.Columns.Add("成绩(六)", typeof(string));
            dt.Columns.Add("考核项目编号(七)", typeof(string));
            dt.Columns.Add("考核项目名称(七)", typeof(string));
            dt.Columns.Add("考试起始时间(七)", typeof(string));
            dt.Columns.Add("考试结束时间(七)", typeof(string));
            dt.Columns.Add("考评员1(七)", typeof(string));
            dt.Columns.Add("考评员2(七)", typeof(string));
            dt.Columns.Add("时长(七)", typeof(string));
            dt.Columns.Add("成绩(七)", typeof(string));
            dt.Columns.Add("考核项目编号(八)", typeof(string));
            dt.Columns.Add("考核项目名称(八)", typeof(string));
            dt.Columns.Add("考试起始时间(八)", typeof(string));
            dt.Columns.Add("考试结束时间(八)", typeof(string));
            dt.Columns.Add("考评员1(八)", typeof(string));
            dt.Columns.Add("考评员2(八)", typeof(string));
            dt.Columns.Add("时长(八)", typeof(string));
            dt.Columns.Add("成绩(八)", typeof(string));
            dt.Columns.Add("考核项目编号(九)", typeof(string));
            dt.Columns.Add("考核项目名称(九)", typeof(string));
            dt.Columns.Add("考试起始时间(九)", typeof(string));
            dt.Columns.Add("考试结束时间(九)", typeof(string));
            dt.Columns.Add("考评员1(九)", typeof(string));
            dt.Columns.Add("考评员2(九)", typeof(string));
            dt.Columns.Add("时长(九)", typeof(string));
            dt.Columns.Add("成绩(九)", typeof(string));
            dt.Columns.Add("考核项目编号(十)", typeof(string));
            dt.Columns.Add("考核项目名称(十)", typeof(string));
            dt.Columns.Add("考试起始时间(十)", typeof(string));
            dt.Columns.Add("考试结束时间(十)", typeof(string));
            dt.Columns.Add("考评员1(十)", typeof(string));
            dt.Columns.Add("考评员2(十)", typeof(string));
            dt.Columns.Add("时长(十)", typeof(string));
            dt.Columns.Add("成绩(十)", typeof(string));
            dt.Columns.Add("总用时", typeof(string));
            dt.Columns.Add("总成绩", typeof(string));
            dt.Columns.Add("补考项目", typeof(string));
            dt.Columns.Add("补考次数", typeof(string));
            dt.Columns.Add("是否合格", typeof(string));

            dt.AcceptChanges();

            Expression<Func<ImpBasicTwo, bool>> where = PredicateExtensionses.True<ImpBasicTwo>();
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var className = Request["ClassName"];
                where = where.And(m => m.ClassName == className);
            }
            if (!string.IsNullOrEmpty(Request["StuID"]))
            {
                var stuID = Request["StuID"];
                where = where.And(m => m.StuID == stuID);
            }
            if (!string.IsNullOrEmpty(Request["StuName"]))
            {
                var stuName = Request["StuName"];
                where = where.And(m => m.StuName == stuName);
            }

            where = where.And(m => m.IsValid);

            var entitys = unitOfWork.ImpBasicTwoBLL.GetEntitys(where).OrderBy(m => m.StuID);
            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();

                    row["发报时间"]=            entity.TelegraphSendDate ;
                    row["收报时间"]=            entity.TelegraphReceiveDate;
                    row["电报号"]=              entity.TelegraphNO;
                    row["电报名称"]=            entity.TelegraphName;
                    row["培训岗位"]=            entity.TrainPostion;
                    row["培训班性质"]=          entity.TrainType;
                    row["班级名称"]=            entity.ClassName;
                    row["开班日期"]=            entity.ClassBeginDate;
                    row["结束日期"]=            entity.ClassEndDate;
                    row["班主任"]=              entity.ClassTeacher;
                    row["教室"]=                entity.ClassRoom ;
                    row["学员编号"]=            entity.StuID;
                    row["姓名"]=                entity.StuName;
                    row["性别"]=                entity.Sex;
                    row["所在路局"]=            entity.RailwayOffice;
                    row["所在站段"]=            entity.Station;
                    row["身份证号"]=            entity.IDCardNO;
                    row["工作证号"]=            entity.WorkID;
                    row["手机号"]=              entity.TelephoneNO;
                    row["抽考项目"]=            entity.ExamineProject;
                    row["考评日期"]=            entity.ExamineDate;
                    row["监考员"]=              entity.Invigilator;
                    row["考核项目编号(一)"]=    entity.P1ExamineProjectID;
                    row["考核项目名称(一)"]=    entity.P1ExamineProjectName;
                    row["考试起始时间(一)"]=    entity.P1ExamineStartTime;
                    row["考试结束时间(一)"]=    entity.P1ExamineEndTime;
                    row["考评员1(一)"]=         entity.P1AssessorOne;
                    row["考评员2(一)"]=         entity.P1AssessorTwo;
                    row["时长(一)"]=            entity.P1ExamineTimeOffset;
                    row["成绩(一)"]=            entity.P1Score;
                    row["考核项目编号(二)"]=    entity.P2ExamineProjectID;
                    row["考核项目名称(二)"]=    entity.P2ExamineProjectName;
                    row["考试起始时间(二)"]=    entity.P2ExamineStartTime;
                    row["考试结束时间(二)"]=    entity.P2ExamineEndTime;
                    row["考评员1(二)"]=         entity.P2AssessorOne;
                    row["考评员2(二)"]=         entity.P2AssessorTwo;
                    row["时长(二)"]=            entity.P2ExamineTimeOffset;
                    row["成绩(二)"]=            entity.P2Score;
                    row["考核项目编号(三)"]=    entity.P3ExamineProjectID;
                    row["考核项目名称(三)"]=    entity.P3ExamineProjectName;
                    row["考试起始时间(三)"]=    entity.P3ExamineStartTime;
                    row["考试结束时间(三)"]=    entity.P3ExamineEndTime;
                    row["考评员1(三)"]=         entity.P3AssessorOne;
                    row["考评员2(三)"]=         entity.P3AssessorTwo;
                    row["时长(三)"]=            entity.P3ExamineTimeOffset;
                    row["成绩(三)"]=            entity.P3Score;
                    row["考核项目编号(四)"]=    entity.P4ExamineProjectID;
                    row["考核项目名称(四)"]=    entity.P4ExamineProjectName;
                    row["考试起始时间(四)"]=    entity.P4ExamineStartTime;
                    row["考试结束时间(四)"]=    entity.P4ExamineEndTime;
                    row["考评员1(四)"]=         entity.P4AssessorOne;
                    row["考评员2(四)"]=         entity.P4AssessorTwo;
                    row["时长(四)"]=            entity.P4ExamineTimeOffset;
                    row["成绩(四)"]=            entity.P4Score;
                    row["考核项目编号(五)"]=    entity.P5ExamineProjectID;
                    row["考核项目名称(五)"]=    entity.P5ExamineProjectName;
                    row["考试起始时间(五)"]=    entity.P5ExamineStartTime;
                    row["考试结束时间(五)"]=    entity.P5ExamineEndTime;
                    row["考评员1(五)"]=         entity.P5AssessorOne;
                    row["考评员2(五)"]=         entity.P5AssessorTwo;
                    row["时长(五)"]=            entity.P5ExamineTimeOffset;
                    row["成绩(五)"]=            entity.P5Score;
                    row["考核项目编号(六)"]=    entity.P6ExamineProjectID;
                    row["考核项目名称(六)"]=    entity.P6ExamineProjectName;
                    row["考试起始时间(六)"]=    entity.P6ExamineStartTime;
                    row["考试结束时间(六)"]=    entity.P6ExamineEndTime;
                    row["考评员1(六)"]=         entity.P6AssessorOne;
                    row["考评员2(六)"]=         entity.P6AssessorTwo;
                    row["时长(六)"]=            entity.P6ExamineTimeOffset;
                    row["成绩(六)"]=            entity.P6Score;
                    row["考核项目编号(七)"]=    entity.P7ExamineProjectID;
                    row["考核项目名称(七)"]=    entity.P7ExamineProjectName;
                    row["考试起始时间(七)"]=    entity.P7ExamineStartTime;
                    row["考试结束时间(七)"]=    entity.P7ExamineEndTime;
                    row["考评员1(七)"]=         entity.P7AssessorOne;
                    row["考评员2(七)"]=         entity.P7AssessorTwo;
                    row["时长(七)"]=            entity.P7ExamineTimeOffset;
                    row["成绩(七)"]=            entity.P7Score;
                    row["考核项目编号(八)"]=    entity.P8ExamineProjectID;
                    row["考核项目名称(八)"]=    entity.P8ExamineProjectName;
                    row["考试起始时间(八)"]=    entity.P8ExamineStartTime;
                    row["考试结束时间(八)"]=    entity.P8ExamineEndTime;
                    row["考评员1(八)"]=         entity.P8AssessorOne;
                    row["考评员2(八)"]=         entity.P8AssessorTwo;
                    row["时长(八)"]=            entity.P8ExamineTimeOffset;
                    row["成绩(八)"]=            entity.P8Score;
                    row["考核项目编号(九)"]=    entity.P9ExamineProjectID;
                    row["考核项目名称(九)"]=    entity.P9ExamineProjectName;
                    row["考试起始时间(九)"]=    entity.P9ExamineStartTime;
                    row["考试结束时间(九)"]=    entity.P9ExamineEndTime;
                    row["考评员1(九)"]=         entity.P9AssessorOne;
                    row["考评员2(九)"]=         entity.P9AssessorTwo;
                    row["时长(九)"]=            entity.P9ExamineTimeOffset;
                    row["成绩(九)"]=            entity.P9Score;
                    row["考核项目编号(十)"]=    entity.P10ExamineProjectID;
                    row["考核项目名称(十)"]=    entity.P10ExamineProjectName;
                    row["考试起始时间(十)"]=    entity.P10ExamineStartTime;
                    row["考试结束时间(十)"]=    entity.P10ExamineEndTime;
                    row["考评员1(十)"]=         entity.P10AssessorOne;
                    row["考评员2(十)"]=         entity.P10AssessorTwo;
                    row["时长(十)"]=            entity.P10ExamineTimeOffset;
                    row["成绩(十)"]=            entity.P10Score;
                    row["总用时"]=              entity.TotalTimeOffset;
                    row["总成绩"]=              entity.TotalScore;
                    row["补考项目"]=            entity.MakeUpProject;
                    row["补考次数"]=            entity.MakeUpTimes;
                    row["是否合格"]=            entity.Passed ;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #16
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-培训师信息.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("专业");
            fieldsNames.Add("路局");
            fieldsNames.Add("单位");
            fieldsNames.Add("姓名");
            fieldsNames.Add("性别");
            fieldsNames.Add("身份证号");
            fieldsNames.Add("教研室");
            fieldsNames.Add("职称");
            fieldsNames.Add("职务");
            fieldsNames.Add("学历");
            fieldsNames.Add("电话");
            fieldsNames.Add("出生年月");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("专业", typeof(string));
            dt.Columns.Add("路局", typeof(string));
            dt.Columns.Add("单位", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("性别", typeof(string));
            dt.Columns.Add("身份证号", typeof(string));
            dt.Columns.Add("教研室", typeof(string));
            dt.Columns.Add("职称", typeof(string));
            dt.Columns.Add("职务", typeof(string));
            dt.Columns.Add("学历", typeof(string));
            dt.Columns.Add("电话", typeof(string));
            dt.Columns.Add("出生年月", typeof(string));
            dt.AcceptChanges();
            var status = (int) EnumStatus.Valid;
            var entitys = unitOfWork.TeacherBLL.GetEntitys(m => m.Ustatus == status);
            if (entitys != null && entitys.Any())
            {
                foreach (var teacher in entitys)
                {
                    var row = dt.NewRow();
                    row["专业"] = teacher.ProfessionalName;
                    row["路局"] = teacher.Luju;
                    row["单位"] = teacher.Department;
                    row["姓名"] = teacher.Name;
                    row["性别"] = teacher.GenderName;
                    row["身份证号"] = teacher.IdNo;
                    row["教研室"] = teacher.DeptName;
                    row["职称"] = teacher.TitleName;
                    row["职务"] = teacher.Position;
                    row["学历"] = teacher.EducationName;
                    row["电话"] = teacher.Tel;
                    if (teacher.BirthDay != null)
                    {
                        row["出生年月"] = Convert.ToDateTime(teacher.BirthDay).ToString("yyyy-MM-dd");
                    }
                    else
                    {
                        row["出生年月"] = "";
                    }
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #17
0
        //导出数据
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = "会议室信息表.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("会议室名称");
            fieldsNames.Add("容纳人数");
            fieldsNames.Add("所在位置");
            fieldsNames.Add("设备");
            fieldsNames.Add("设备巡检时间");
            fieldsNames.Add("下次设备巡检时间");
            fieldsNames.Add("设备状态");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("会议室名称", typeof(string));
            dt.Columns.Add("容纳人数", typeof(string));
            dt.Columns.Add("所在位置", typeof(string));
            dt.Columns.Add("设备", typeof(string));
            dt.Columns.Add("设备巡检时间", typeof(string));
            dt.Columns.Add("下次设备巡检时间", typeof(string));
            dt.Columns.Add("设备状态", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<MeetingRoom, bool>> where = PredicateExtensionses.True<MeetingRoom>();
            if (!string.IsNullOrEmpty(Request["RoomName"]))
            {
                var roomName = Request["RoomName"];
                where = where.And(m => m.RoomName.Contains(roomName));
            }
            if (!string.IsNullOrEmpty(Request["Volume"]))
            {
                var volume = Request["Volume"];
                where = where.And(m => m.Volume.Contains(volume));
            }
            if (!string.IsNullOrEmpty(Request["Location"]))
            {
                var location = Request["Location"];
                where = where.And(m => m.Location.Contains(location));
            }
            if (!string.IsNullOrEmpty(Request["Device"]))
            {
                var device = Request["Device"];
                where = where.And(m => m.Device.Contains(device));
            }
            where.And(m => m.IsValid);

            var entitys = unitOfWork.MeetingRoomBLL.GetEntitys(where);
            if (entitys != null && entitys.Any())
            {
                foreach (var meeting in entitys)
                {
                    var row = dt.NewRow();
                    row["会议室名称"] = meeting.RoomName;
                    row["容纳人数"] = meeting.Volume;
                    row["所在位置"] = meeting.Location;
                    row["设备"] = meeting.Device;
                    row["设备巡检时间"] = meeting.DeviceExamineDate;
                    row["下次设备巡检时间"] = meeting.DeviceExamineNextDate;
                    row["设备状态"] = meeting.DeviceStatus;
                    row["备注"] = meeting.Remark;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
        //导出数据
        public void Downloaddata_Approve()
        {
            var exXls = new ExportXls();
            var filename = "会议室申请信息表.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("会议名称");
            fieldsNames.Add("会议负责人");
            fieldsNames.Add("参会人数");
            fieldsNames.Add("参会人员");
            fieldsNames.Add("使用日期");
            fieldsNames.Add("起始时间");
            fieldsNames.Add("截止时间");
            fieldsNames.Add("备注");
            fieldsNames.Add("申请人");
            fieldsNames.Add("申请时间");
            fieldsNames.Add("是否通过");
            fieldsNames.Add("不通过原因");
            fieldsNames.Add("会议室名称");
            fieldsNames.Add("分配人");
            fieldsNames.Add("分配时间");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("会议名称", typeof(string));
            dt.Columns.Add("会议负责人", typeof(string));
            dt.Columns.Add("参会人数", typeof(string));
            dt.Columns.Add("参会人员", typeof(string));
            dt.Columns.Add("使用日期", typeof(string));
            dt.Columns.Add("起始时间", typeof(string));
            dt.Columns.Add("截止时间", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.Columns.Add("申请人", typeof(string));
            dt.Columns.Add("申请时间", typeof(string));
            dt.Columns.Add("是否通过", typeof(string));
            dt.Columns.Add("不通过原因", typeof(string));
            dt.Columns.Add("会议室名称", typeof(string));
            dt.Columns.Add("分配人", typeof(string));
            dt.Columns.Add("分配时间", typeof(string));
            dt.AcceptChanges();

            Expression<Func<MeetingRoomRecord, bool>> where = PredicateExtensionses.True<MeetingRoomRecord>();
            if (!string.IsNullOrEmpty(Request["MeetingName"]))
            {
                var meetingName = Request["MeetingName"];
                where = where.And(m => m.MeetingName.Contains(meetingName));
            }
            DateTime meetingDate;
            if (!string.IsNullOrEmpty(Request["MeetingDate"]))
            {
                meetingDate = Convert.ToDateTime(Request["MeetingDate"]);
                where = where.And(m => m.MeetingDate == meetingDate);
            }
            if (!string.IsNullOrEmpty(Request["MeetingRoomName"]))
            {
                var meetingRoomName = Request["MeetingRoomName"];
                where = where.And(m => m.MeetingRoomName.Contains(meetingRoomName));
            }
            if (!string.IsNullOrEmpty(Request["ApplicantName"]))
            {
                var applicantName = Request["ApplicantName"];
                where = where.And(m => m.ApplicantName.Contains(applicantName));
            }
            if (!string.IsNullOrEmpty(Request["IsApproved"]))
            {
                var isApproved = Request["IsApproved"];
                if (isApproved == "是")
                {
                    where = where.And(m => m.IsApproved != null);
                }
                else
                {
                    where = where.And(m => m.IsApproved == null);
                }
            }
            where.And(m => m.IsValid);

            var entitys = unitOfWork.MeetingRoomRecordBLL.GetEntitys(where);
            if (entitys != null && entitys.Any())
            {
                foreach (var meeting in entitys)
                {
                    var row = dt.NewRow();
                    row["会议名称"] = meeting.MeetingName;
                    row["会议负责人"] = meeting.MeetingCharge;
                    row["参会人数"] = meeting.MeetingNum;
                    row["参会人员"] = meeting.MeetingMember;
                    row["使用日期"] = ConvertUtil.ConvertNullableDatetimeToString(meeting.MeetingDate);
                    row["起始时间"] = meeting.MeetingTimeBegin;
                    row["截止时间"] = meeting.MeetingTimeEnd;
                    row["备注"] = meeting.Remark;
                    row["申请人"] = meeting.ApplicantName;
                    row["申请时间"] = meeting.ApplyDate;
                    row["是否通过"] = meeting.IsApproved;
                    row["不通过原因"] = meeting.NotApprovedReason;
                    row["会议室名称"] = meeting.MeetingRoomName;
                    row["分配人"] = meeting.ApprovalPersonName;
                    row["分配时间"] = meeting.ApprovalDate;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #19
0
        public void DownloaddataImp()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-实作考评成绩汇总信息.xls";

            //学员编号	姓名	身份证号	考评岗位	班级名称	所在站段	抽考项目
            //考评项目1-编号	考评项目1-成绩	考评项目2-编号	考评项目2-成绩	考评项目3-编号	考评项目3-成绩
            //考评项目4-编号	考评项目4-成绩	考评项目5-编号	考评项目5-成绩	考评项目6-编号	考评项目6-成绩
            //总用时	总成绩	考评结果	备注

            var fieldsNames = new List<string>();
            fieldsNames.Add("学员编号");
            fieldsNames.Add("姓名");
            fieldsNames.Add("身份证号");
            fieldsNames.Add("考评岗位");
            fieldsNames.Add("班级名称");
            fieldsNames.Add("所在站段");
            fieldsNames.Add("抽考项目");
            fieldsNames.Add("考评项目1-编号");
            fieldsNames.Add("考评项目1-成绩");
            fieldsNames.Add("考评项目2-编号");
            fieldsNames.Add("考评项目2-成绩");
            fieldsNames.Add("考评项目3-编号");
            fieldsNames.Add("考评项目3-成绩");
            fieldsNames.Add("考评项目4-编号");
            fieldsNames.Add("考评项目4-成绩");
            fieldsNames.Add("考评项目5-编号");
            fieldsNames.Add("考评项目5-成绩");
            fieldsNames.Add("考评项目6-编号");
            fieldsNames.Add("考评项目6-成绩");
            fieldsNames.Add("总用时");
            fieldsNames.Add("总成绩");
            fieldsNames.Add("考评结果");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("身份证号", typeof(string));
            dt.Columns.Add("考评岗位", typeof(string));
            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("所在站段", typeof(string));
            dt.Columns.Add("抽考项目", typeof(string));

            dt.Columns.Add("考评项目1-编号", typeof(string));
            dt.Columns.Add("考评项目1-成绩", typeof(string));
            dt.Columns.Add("考评项目2-编号", typeof(string));
            dt.Columns.Add("考评项目2-成绩", typeof(string));
            dt.Columns.Add("考评项目3-编号", typeof(string));
            dt.Columns.Add("考评项目3-成绩", typeof(string));
            dt.Columns.Add("考评项目4-编号", typeof(string));
            dt.Columns.Add("考评项目4-成绩", typeof(string));
            dt.Columns.Add("考评项目5-编号", typeof(string));
            dt.Columns.Add("考评项目5-成绩", typeof(string));
            dt.Columns.Add("考评项目6-编号", typeof(string));
            dt.Columns.Add("考评项目6-成绩", typeof(string));

            dt.Columns.Add("总用时", typeof(string));
            dt.Columns.Add("总成绩", typeof(string));
            dt.Columns.Add("考评结果", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<Implementation, bool>> where = PredicateExtensionses.True<Implementation>();

            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var className = Request["ClassName"];
                where = where.And(m => m.ClassName.Contains(className));
            }
            if (!string.IsNullOrEmpty(Request["Zhanduan"]))
            {
                var Zhanduan = Request["Zhanduan"];
                where = where.And(m => m.Zhanduan.Contains(Zhanduan));
            }
            if (!string.IsNullOrEmpty(Request["Subjects"]))
            {
                var subjects = Request["Subjects"];
                where = where.And(m => m.Subjects.Contains(subjects));
            }
            if (!string.IsNullOrEmpty(Request["StuName"]))
            {
                var StuName = Request["StuName"];
                where = where.And(m => m.StuName.Contains(StuName));
            }
            if (!string.IsNullOrEmpty(Request["StuNo"]))
            {
                var stuNo = Request["StuNo"];
                where = where.And(m => m.StuNo.Contains(stuNo));
            }

            where = where.And(m => m.IsValid);
            var entitys = unitOfWork.ImplementationBLL.GetEntitys(where).OrderBy(m => m.StuNo);

            if (entitys != null && entitys.Any())
            {
                foreach (var dist in entitys)
                {
                    var row = dt.NewRow();
                    row["学员编号"] = dist.StuNo;
                    row["姓名"] = dist.StuName;

                    //var entity = unitOfWork.StudentBLL.GetEntityByID(dist.StuId);
                    //if (entity != null)
                    //{
                    //    row["性别"] = entity.GenderName;
                    //    row["工作证号"] = entity.WorkIdNo;
                    //    row["身份证号"] = entity.IdNo;
                    //    row["手机号"] = entity.CellPhoneNo;
                    //}

                    row["身份证号"] = dist.IdNo;
                    row["考评岗位"] = dist.ExaminePosition;

                    row["班级名称"] = dist.ClassName;
                    row["所在站段"] = dist.Zhanduan;
                    row["抽考项目"] = dist.Subjects;

                    row["考评项目1-编号"] = dist.Subject1No;
                    row["考评项目1-成绩"] = dist.Subject1Score;
                    row["考评项目2-编号"] = dist.Subject2No;
                    row["考评项目2-成绩"] = dist.Subject2Score;
                    row["考评项目3-编号"] = dist.Subject3No;
                    row["考评项目3-成绩"] = dist.Subject3Score;
                    row["考评项目4-编号"] = dist.Subject4No;
                    row["考评项目4-成绩"] = dist.Subject4Score;
                    row["考评项目5-编号"] = dist.Subject5No;
                    row["考评项目5-成绩"] = dist.Subject5Score;
                    row["考评项目6-编号"] = dist.Subject6No;
                    row["考评项目6-成绩"] = dist.Subject6Score;

                    row["总用时"] = dist.UseTime;
                    row["总成绩"] = dist.Score;
                    row["考评结果"] = dist.ExamineResult;
                    row["备注"] = dist.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #20
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = "优秀学员信息表.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("学员姓名");
            fieldsNames.Add("性别");
            fieldsNames.Add("学员编号");
            fieldsNames.Add("身份证号");
            fieldsNames.Add("单位及职务");
            fieldsNames.Add("班级名称");
            fieldsNames.Add("班主任姓名");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("学员姓名", typeof(string));
            dt.Columns.Add("性别", typeof(string));
            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("身份证号", typeof(string));
            dt.Columns.Add("单位及职务", typeof(string));
            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("班主任姓名", typeof(string));

            dt.AcceptChanges();

            Expression<Func<ViewLujuTrainer, bool>> where = PredicateExtensionses.True<ViewLujuTrainer>();

            if (!string.IsNullOrEmpty(Request["Name"]))
            {
                var name = Request["Name"];
                where = where.And(m => m.Name.Contains(name));
            }
            if (!string.IsNullOrEmpty(Request["Gender"]) && Request["Gender"] != "0")
            {
                var gender = Request["Gender"];
                where = where.And(m => m.Gender == gender);
            }
            if (!string.IsNullOrEmpty(Request["DeptName"]))
            {
                var deptName = Request["DeptName"];
                where = where.And(m => m.DeptName.Contains(deptName));
            }
            if (!string.IsNullOrEmpty(Request["StuNo"]))
            {
                var stuNo = Request["StuNo"];
                where = where.And(m => m.StuNo.Contains(stuNo));
            }
            if (!string.IsNullOrEmpty(Request["HeadmasterName"]))
            {
                var headmasterName = Request["HeadmasterName"];
                where = where.And(m => m.HeadmasterName.Contains(headmasterName));
            }
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var ClassName = Request["ClassName"];
                where = where.And(m => m.ClassName.Contains(ClassName));
            }

            where = where.And(m => m.IsValid && m.IsExc);
            var entitys = unitOfWork.ViewLujuTrainerBLL.GetEntitys(where, m => m.OrderByDescending(u => u.CreateTime).OrderBy(u => u.Ustatus));

            if (entitys != null && entitys.Any())
            {
                foreach (var stu in entitys)
                {
                    var row = dt.NewRow();
                    row["学员姓名"] = stu.Name;
                    row["性别"] = stu.GenderName;
                    row["学员编号"] = stu.StuNo;
                    row["身份证号"] = stu.IdNo;
                    row["单位及职务"] = stu.DeptName;
                    row["班级名称"] = stu.ClassName;
                    row["班主任姓名"] = stu.HeadmasterName;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #21
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-班级信息.xls";

            var fieldsNames = new List<string>();

            fieldsNames.Add("班级名称");
            fieldsNames.Add("教研室");
            fieldsNames.Add("班主任");
            fieldsNames.Add("班主任联系方式");
            fieldsNames.Add("专业");
            fieldsNames.Add("培训类别");
            fieldsNames.Add("培训方式");
            fieldsNames.Add("培训单价");
            fieldsNames.Add("年份");
            fieldsNames.Add("期数");

            fieldsNames.Add("开班日期");
            fieldsNames.Add("结业日期");
            fieldsNames.Add("计划人数");
            fieldsNames.Add("实到人数");
            fieldsNames.Add("教室编号");
            fieldsNames.Add("电报号");
            fieldsNames.Add("班级活动时间");
            fieldsNames.Add("班级活动项目");
            fieldsNames.Add("班级活动经费");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("教研室", typeof(string));
            dt.Columns.Add("班主任", typeof(string));
            dt.Columns.Add("班主任联系方式", typeof(string));
            dt.Columns.Add("专业", typeof(string));
            dt.Columns.Add("培训类别", typeof(string));
            dt.Columns.Add("培训方式", typeof(string));
            dt.Columns.Add("培训单价", typeof(string));
            dt.Columns.Add("年份", typeof(string));
            dt.Columns.Add("期数", typeof(string));
            dt.Columns.Add("开班日期", typeof(DateTime));
            dt.Columns.Add("结业日期", typeof(DateTime));
            dt.Columns.Add("计划人数", typeof(Int32));
            dt.Columns.Add("实到人数", typeof(Int32));

            dt.Columns.Add("教室编号", typeof(string));
            dt.Columns.Add("电报号", typeof(string));
            dt.Columns.Add("班级活动时间", typeof(string));
            dt.Columns.Add("班级活动项目", typeof(string));
            dt.Columns.Add("班级活动经费", typeof(string));

            dt.AcceptChanges();

            Expression<Func<ClassInfo, bool>> where = PredicateExtensionses.True<ClassInfo>();

            if (!string.IsNullOrEmpty(Request["TrainTypeNo"]))
            {
                var trainTypeNo = Request["TrainTypeNo"];
                where = where.And(m => m.TrainTypeNo == (trainTypeNo));
            }
            if (!string.IsNullOrEmpty(Request["TrainFormatNo"]))
            {
                var trainFormatNo = Request["TrainFormatNo"];
                where = where.And(m => m.TrainFormatNo == trainFormatNo);
            }
            if (!string.IsNullOrEmpty(Request["TheYear"]))
            {
                var theYear = Request["TheYear"];
                where = where.And(m => m.TheYear.Contains(theYear));
            }
            if (!string.IsNullOrEmpty(Request["ProfessionNo"]))
            {
                var professionNo = Request["ProfessionNo"];
                where = where.And(m => m.ProfessionNo.Contains(professionNo));
            }
            if (!string.IsNullOrEmpty(Request["ThePeriod"]))
            {
                var thePeriod = Request["ThePeriod"];
                where = where.And(m => m.ThePeriod.Contains(thePeriod));
            }
            if (!string.IsNullOrEmpty(Request["Name"]))
            {
                var name = Request["Name"];
                where = where.And(m => m.Name.Contains(name));
            }

            where = where.And(m => m.IsValid);
            var entitys = unitOfWork.ClassInfoBLL.GetEntitys(where).OrderBy(m => m.Name);

            if (entitys != null && entitys.Any())
            {
                foreach (var student in entitys)
                {
                    var row = dt.NewRow();
                    row["班级名称"] = student.Name;
                    row["教研室"] = student.DeptName;
                    row["班主任"] = student.HeadmasterName;
                    row["班主任联系方式"] = student.HeadmasterTel;
                    row["专业"] = student.ProfessionName;
                    row["培训类别"] = student.TrainTypeName;
                    row["培训方式"] = student.TrainFormatName;
                    row["培训单价"] = student.TrainPrice;
                    row["年份"] = student.TheYear;
                    row["期数"] = student.ThePeriod;

                    row["开班日期"] = ConvertUtil.ConvertNullableDatetimeToString(student.BeginTime);
                    row["结业日期"] = ConvertUtil.ConvertNullableDatetimeToString(student.EndTime);
                    row["计划人数"] = student.ClassPlanSum;
                    row["实到人数"] = student.ClassSum;
                    row["教室编号"] = student.ClassRoomNo;
                    row["电报号"] = student.TelexNum;

                    row["班级活动时间"] = student.ClassActivityTime;
                    row["班级活动项目"] = student.ClassActivityProject;
                    row["班级活动经费"] = student.ClassActivityFunds;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-实作考评成绩登记表.xls";

            //学员编号	姓名 培训班名称 考评表编号	抽考项目	考评项目编号	考评项目名称
            //考评员1 考评员1-成绩	考评员2	 考评员2-成绩 监考员	考评日期	考评开始时间
            //考评结束时间	考评时长	项目成绩	考评性质	备注
            var fieldsNames = new List<string>();
            fieldsNames.Add("学员编号");
            fieldsNames.Add("培训班名称");
            fieldsNames.Add("姓名");
            fieldsNames.Add("考评表编号");
            fieldsNames.Add("抽考项目");
            fieldsNames.Add("考评项目编号");
            fieldsNames.Add("考评项目名称");
            fieldsNames.Add("考评员1");
            fieldsNames.Add("考评员1-成绩");
            fieldsNames.Add("考评员2");
            fieldsNames.Add("考评员2-成绩");
            fieldsNames.Add("监考员");
            fieldsNames.Add("考评日期");
            fieldsNames.Add("考评开始时间");
            fieldsNames.Add("考评结束时间");
            fieldsNames.Add("考评时长");
            fieldsNames.Add("项目成绩");
            fieldsNames.Add("考评性质");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("培训班名称", typeof(string));
            dt.Columns.Add("考评表编号", typeof(string));
            dt.Columns.Add("抽考项目", typeof(string));
            dt.Columns.Add("考评项目编号", typeof(string));
            dt.Columns.Add("考评项目名称", typeof(string));
            dt.Columns.Add("考评员1", typeof(string));
            dt.Columns.Add("考评员1-成绩", typeof(string));
            dt.Columns.Add("考评员2", typeof(string));
            dt.Columns.Add("考评员2-成绩", typeof(string));
            dt.Columns.Add("监考员", typeof(string));
            dt.Columns.Add("考评日期", typeof(string));
            dt.Columns.Add("考评开始时间", typeof(string));
            dt.Columns.Add("考评结束时间", typeof(string));
            dt.Columns.Add("考评时长", typeof(string));
            dt.Columns.Add("项目成绩", typeof(string));
            dt.Columns.Add("考评性质", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<ImpTeachPlanStatTwo, bool>> where = PredicateExtensionses.True<ImpTeachPlanStatTwo>();
            if (!string.IsNullOrEmpty(Request["StuID"]))
            {
                var stuID = Request["StuID"];
                where = where.And(m => m.StuID == stuID);
            }
            if (!string.IsNullOrEmpty(Request["StuName"]))
            {
                var stuName = Request["StuName"];
                where = where.And(m => m.StuName == stuName);
            }
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var className = Request["ClassName"];
                where = where.And(m => m.ClassName == className);
            }
            if (!string.IsNullOrEmpty(Request["ExamineProjectName"]))
            {
                var examineProjectName = Request["ExamineProjectName"];
                where = where.And(m => m.ExamineProjectName == examineProjectName);
            }
            if (!string.IsNullOrEmpty(Request["Assessor"]))
            {
                var assessor = Request["Assessor"];
                where = where.And(m => (m.AssessorOne == assessor || m.AssessorTwo == assessor));
            }
            if (!string.IsNullOrEmpty(Request["ExamineTableID"]))
            {
                var examineTableID = Request["ExamineTableID"];
                where = where.And(m => m.ExamineTableID == examineTableID);
            }

            where = where.And(m => m.IsValid);

            var entitys = unitOfWork.ImpTeachPlanStatTwoBLL.GetEntitys(where).OrderBy(m => m.StuID);
            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();
                    row["学员编号"] = entity.StuID;
                    row["姓名"] = entity.StuName;
                    row["培训班名称"] = entity.ClassName;
                    row["考评表编号"] = entity.ExamineTableID;
                    row["抽考项目"] = entity.ExamineProject;
                    row["考评项目编号"] = entity.ExamineProjectID;
                    row["考评项目名称"] = entity.ExamineProjectName;
                    row["考评员1"] = entity.AssessorOne;
                    row["考评员1-成绩"] = ConvertUtil.ConvertNullableDecimalToString(entity.AssessorOneScore);
                    row["考评员2"] = entity.AssessorTwo;
                    row["考评员2-成绩"] = ConvertUtil.ConvertNullableDecimalToString(entity.AssessorOneScore);
                    row["监考员"] = entity.Invigilator;
                    row["考评日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ExamineDate);
                    row["考评开始时间"] = entity.ExamineStartTime;
                    row["考评结束时间"] = entity.ExamineEndTime;
                    row["考评时长"] = entity.ExamineTimeOffset;
                    row["项目成绩"] = ConvertUtil.ConvertNullableDecimalToString(entity.Score);
                    row["考评性质"] = entity.ExamineType;
                    row["备注"] = entity.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #23
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = "班主任信息.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("姓名");
            fieldsNames.Add("教研室");
            fieldsNames.Add("专业");
            fieldsNames.Add("联系方式");

            var ds = new DataSet();
            var dt = new DataTable();
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("教研室", typeof(string));
            dt.Columns.Add("专业", typeof(string));
            dt.Columns.Add("联系方式", typeof(string));
            dt.AcceptChanges();

            Expression<Func<Headmaster, bool>> where = PredicateExtensionses.True<Headmaster>();
            if (!string.IsNullOrEmpty(Request["Name"]))
            {
                var name = Request["Name"];
                where = where.And(m => m.Name.Contains(name));
            }
            if (!string.IsNullOrEmpty(Request["DeptID"]))
            {
                var deptID = Convert.ToInt32(Request["DeptID"]);
                where = where.And(m => m.DeptID == deptID);
            }
            where = where.And(m => m.IsValid);
            var entitys = unitOfWork.HeadmasterBLL.GetEntitys(where).OrderByDescending(m => m.CreateTime);

            if (entitys != null && entitys.Any())
            {
                foreach (var head in entitys)
                {
                    var row = dt.NewRow();
                    row["姓名"] = head.Name;
                    row["教研室"] = head.DeptName;
                    row["专业"] = head.ProfessionalName;
                    row["联系方式"] = head.Tel;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #24
0
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-实作考核计划安排.xls";

            //班级名称	班主任 课程计划编号	开班日期	结束日期	考核项目编号	考核项目名称
            //课程计划考评日期	考试起始时间	考试结束时间	考核地点	考核组织形式
            //考核说明	监考员	考评员1	考评员2	备注
            var fieldsNames = new List<string>();
            fieldsNames.Add("班级名称");
            fieldsNames.Add("班主任");
            fieldsNames.Add("课程计划编号");
            fieldsNames.Add("开班日期");
            fieldsNames.Add("结束日期");
            fieldsNames.Add("考核项目编号");
            fieldsNames.Add("考核项目名称");
            fieldsNames.Add("课程计划考评日期");
            fieldsNames.Add("考试起始时间");
            fieldsNames.Add("考试结束时间");
            fieldsNames.Add("考核地点");
            fieldsNames.Add("考核组织形式");
            fieldsNames.Add("考核说明");
            fieldsNames.Add("监考员");
            fieldsNames.Add("考评员1");
            fieldsNames.Add("考评员2");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("班主任", typeof(string));
            dt.Columns.Add("课程计划编号", typeof(string));
            dt.Columns.Add("开班日期", typeof(string));
            dt.Columns.Add("结束日期", typeof(string));
            dt.Columns.Add("考核项目编号", typeof(string));
            dt.Columns.Add("考核项目名称", typeof(string));
            dt.Columns.Add("课程计划考评日期", typeof(string));
            dt.Columns.Add("考试起始时间", typeof(string));
            dt.Columns.Add("考试结束时间", typeof(string));
            dt.Columns.Add("考核地点", typeof(string));
            dt.Columns.Add("考核组织形式", typeof(string));
            dt.Columns.Add("考核说明", typeof(string));
            dt.Columns.Add("监考员", typeof(string));
            dt.Columns.Add("考评员1", typeof(string));
            dt.Columns.Add("考评员2", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<ImpExaminePlan, bool>> where = PredicateExtensionses.True<ImpExaminePlan>();
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var className = Request["ClassName"];
                where = where.And(m => m.ClassName == className);
            }
            if (!string.IsNullOrEmpty(Request["CoursePlanExamineDate"]))
            {
                var coursePlanExamineDate =Convert.ToDateTime(Request["CoursePlanExamineDate"]);
                where = where.And(m => m.CoursePlanExamineDate == coursePlanExamineDate);
            }
            if (!string.IsNullOrEmpty(Request["CoursePlanID"]))
            {
                var coursePlanID = Request["CoursePlanID"];
                where = where.And(m => m.CoursePlanID == coursePlanID);
            }
            if (!string.IsNullOrEmpty(Request["ExamineProjectName"]))
            {
                var examineProjectName = Request["ExamineProjectName"];
                where = where.And(m => m.ExamineProjectName == examineProjectName);
            }

            where = where.And(m => m.IsValid);

            var entitys = unitOfWork.ImpExaminePlanBLL.GetEntitys(where).OrderBy(m => m.ClassName);
            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();
                    row["班级名称"] = entity.ClassName;
                    row["班主任"] = entity.ClassTeacher;
                    row["课程计划编号"] = entity.CoursePlanID;
                    row["开班日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ClassBeginDate);
                    row["结束日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ClassEndDate);
                    row["考核项目编号"] = entity.ExamineProjectID;
                    row["考核项目名称"] = entity.ExamineProjectName;
                    row["课程计划考评日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.CoursePlanExamineDate);
                    row["考试起始时间"] = entity.ExamineStartTime;
                    row["考试结束时间"] = entity.ExamineEndTime;
                    row["考核地点"] = entity.ExaminePlace;
                    row["考核组织形式"] = entity.ExamineOraganizeType;
                    row["考核说明"] = entity.ExamineDesc;
                    row["监考员"] = entity.Invigilator;
                    row["考评员1"] = entity.AssessorOne;
                    row["考评员2"] = entity.AssessorTwo;
                    row["备注"] = entity.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #25
0
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-学员成绩汇总.xls";

            //学员编号	姓名	身份证号	班级名称	所在站段
            //岗位名称	培训性质	综合得分	安全成绩	理论成绩	实作成绩	培训成绩
            //成绩性质	资格审核	证件编号	发证日期	证件性质	备注

            var fieldsNames = new List<string>();
            fieldsNames.Add("学员编号");
            fieldsNames.Add("姓名");
            fieldsNames.Add("身份证号");
            fieldsNames.Add("班级名称");
            fieldsNames.Add("所在站段");
            fieldsNames.Add("岗位名称");
            fieldsNames.Add("培训性质");
            fieldsNames.Add("综合得分");
            fieldsNames.Add("安全成绩");
            fieldsNames.Add("理论成绩");
            fieldsNames.Add("实作成绩");
            fieldsNames.Add("培训成绩");
            fieldsNames.Add("成绩性质");
            fieldsNames.Add("资格审核");
            fieldsNames.Add("证件编号");
            fieldsNames.Add("发证日期");
            fieldsNames.Add("证件性质");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("身份证号", typeof(string));
            dt.Columns.Add("班级名称", typeof(string));
            dt.Columns.Add("所在站段", typeof(string));
            dt.Columns.Add("岗位名称", typeof(string));
            dt.Columns.Add("培训性质", typeof(string));
            dt.Columns.Add("综合得分", typeof(string));
            dt.Columns.Add("安全成绩", typeof(string));
            dt.Columns.Add("理论成绩", typeof(string));
            dt.Columns.Add("实作成绩", typeof(string));
            dt.Columns.Add("培训成绩", typeof(string));
            dt.Columns.Add("成绩性质", typeof(string));
            dt.Columns.Add("资格审核", typeof(string));
            dt.Columns.Add("证件编号", typeof(string));
            dt.Columns.Add("发证日期", typeof(string));
            dt.Columns.Add("证件性质", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<ExamineScore, bool>> where = PredicateExtensionses.True<ExamineScore>();

            if (!string.IsNullOrEmpty(Request["StuID"]))
            {
                var stuID = Request["StuID"];
                where = where.And(m => m.StuID == stuID);
            }
            if (!string.IsNullOrEmpty(Request["StuName"]))
            {
                var stuName = Request["StuName"];
                where = where.And(m => m.StuName == stuName);
            }
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var className = Request["ClassName"];
                where = where.And(m => m.ClassName == className);
            }
            if (!string.IsNullOrEmpty(Request["PostionName"]))
            {
                var postionName = Request["PostionName"];
                where = where.And(m => m.PostionName == postionName);
            }

            where = where.And(m => m.IsValid);
            var entitys = unitOfWork.ExamineScoreBLL.GetEntitys(where).OrderBy(m => m.StuID);

            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();
                    row["学员编号"] = entity.StuID;
                    row["姓名"] = entity.StuName;
                    row["身份证号"] = entity.IDCardNO;
                    row["班级名称"] = entity.ClassName;
                    row["所在站段"] = entity.Station;
                    row["岗位名称"] = entity.PostionName;
                    row["培训性质"] = entity.TrainType;
                    row["综合得分"] = entity.TotalScore;
                    row["安全成绩"] = entity.SecurityScore;
                    row["理论成绩"] = entity.TheoryScore;
                    row["实作成绩"] = entity.ImpScore;
                    row["培训成绩"] = entity.TrainScore;
                    row["成绩性质"] = entity.ScoreType;
                    row["资格审核"] = entity.Qualification;
                    row["证件编号"] = entity.PaperID;
                    row["发证日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.PaperIssuedDate);
                    row["证件性质"] = entity.PaperType;
                    row["备注"] = entity.Remark;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-学员培训考试情况表.xls";

            //序号  学员编号  班级 姓名  单位  岗位  性别  年龄  安全知识成绩
            //理论知识成绩   实作考核成绩   办证情况 备注

            var fieldsNames = new List<string>();
            fieldsNames.Add("序号");
            fieldsNames.Add("学员编号");
            fieldsNames.Add("班级");
            fieldsNames.Add("姓名");
            fieldsNames.Add("单位");
            fieldsNames.Add("岗位");
            fieldsNames.Add("性别");
            fieldsNames.Add("年龄");
            fieldsNames.Add("安全知识成绩");
            fieldsNames.Add("理论知识成绩");
            fieldsNames.Add("实作考核成绩");
            fieldsNames.Add("办证情况");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("序号", typeof(string));
            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("班级", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("单位", typeof(string));
            dt.Columns.Add("岗位", typeof(string));
            dt.Columns.Add("性别", typeof(string));
            dt.Columns.Add("年龄", typeof(string));
            dt.Columns.Add("安全知识成绩", typeof(string));
            dt.Columns.Add("理论知识成绩", typeof(string));
            dt.Columns.Add("实作考核成绩", typeof(string));
            dt.Columns.Add("办证情况", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            Expression<Func<V_Examine, bool>> where = PredicateExtensionses.True<V_Examine>();

            if (!string.IsNullOrEmpty(Request["StuID_Begin"]))
            {
                var stuID_Begin = Request["StuID_Begin"];
                where = where.And(m => m.StuID.CompareTo(stuID_Begin)>=0);
            }
            if (!string.IsNullOrEmpty(Request["StuName_End"]))
            {
                var stuName_End = Request["StuName_End"];
                where = where.And(m => m.StuID.CompareTo(stuName_End)<=0);
            }
            if (!string.IsNullOrEmpty(Request["ClassName"]))
            {
                var className = Request["ClassName"];
                where = where.And(m => m.ClassName == className);
            }

            var entitys = unitOfWork.V_ExamineBLL.GetEntitys(where).OrderBy(m => m.StuID);

            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();
                    row["序号"] = entity.seq.ToString();
                    row["学员编号"] = entity.StuID;
                    row["班级"] = entity.ClassName;
                    row["姓名"] = entity.StuName;
                    row["单位"] = entity.Station;
                    row["岗位"] = entity.PostionName;
                    row["性别"] = entity.Gender;
                    row["年龄"] = entity.Age.ToString();
                    row["安全知识成绩"] = entity.SecurityScore;
                    row["理论知识成绩"] = entity.TheoryScore;
                    row["实作考核成绩"] = entity.ImpScore;
                    row["办证情况"] = entity.Passed;
                    row["备注"] = entity.Remark;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #27
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-电子教室信息.xls";

            // 		楼层	房间号	房间名称	容量	备注

            var fieldsNames = new List<string>();
            fieldsNames.Add("楼层");
            fieldsNames.Add("房间号");
            fieldsNames.Add("容纳人数");
            fieldsNames.Add("设备说明");
            fieldsNames.Add("使用时间(起)");
            fieldsNames.Add("使用时间(止)");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("楼层", typeof(string));
            dt.Columns.Add("房间号", typeof(string));
            dt.Columns.Add("容纳人数", typeof(string));
            dt.Columns.Add("设备说明", typeof(string));
            dt.Columns.Add("使用时间(起)", typeof(string));
            dt.Columns.Add("使用时间(止)", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            var entitys = unitOfWork.EclassInfoBLL.GetEntitys(m => m.IsValid);
            if (entitys != null && entitys.Any())
            {
                foreach (var classRoom in entitys)
                {
                    var row = dt.NewRow();
                    row["楼层"] = classRoom.FloorNo;
                    row["房间号"] = classRoom.RoomNo;
                    row["容纳人数"] = classRoom.Volume;
                    row["设备说明"] = classRoom.Equipment;
                    row["使用时间(起)"] = classRoom.LastUseTimeBegin == null ? "" : Convert.ToDateTime(classRoom.LastUseTimeBegin).ToString("yyyy-MM-dd");
                    row["使用时间(止)"] = classRoom.LastUseTimeEnd == null ? "" : Convert.ToDateTime(classRoom.LastUseTimeEnd).ToString("yyyy-MM-dd");
                    row["备注"] = classRoom.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
        public void Export()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-认证部反馈实作基本表1.xls";

            //学员编号	姓名	培训单位	身份证号	考试岗位	培训班名称
            //培训开始时间	培训结束时间	考核项目编号	考核项目名称	考评员	考评助理
            //考评日期	考核用时	项目成绩	备注

            var fieldsNames = new List<string>();
            fieldsNames.Add("学员编号");
            fieldsNames.Add("姓名");
            fieldsNames.Add("培训单位");
            fieldsNames.Add("身份证号");
            fieldsNames.Add("考试岗位");
            fieldsNames.Add("培训班名称");
            fieldsNames.Add("培训开始时间");
            fieldsNames.Add("培训结束时间");
            fieldsNames.Add("考核项目编号");
            fieldsNames.Add("考核项目名称");
            fieldsNames.Add("考评员");
            fieldsNames.Add("考评助理");
            fieldsNames.Add("考评日期");
            fieldsNames.Add("考核用时");
            fieldsNames.Add("项目成绩");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("学员编号", typeof(string));
            dt.Columns.Add("姓名", typeof(string));
            dt.Columns.Add("培训单位", typeof(string));
            dt.Columns.Add("身份证号", typeof(string));
            dt.Columns.Add("考试岗位", typeof(string));
            dt.Columns.Add("培训班名称", typeof(string));
            dt.Columns.Add("培训开始时间", typeof(string));
            dt.Columns.Add("培训结束时间", typeof(string));
            dt.Columns.Add("考核项目编号", typeof(string));
            dt.Columns.Add("考核项目名称", typeof(string));
            dt.Columns.Add("考评员", typeof(string));
            dt.Columns.Add("考评助理", typeof(string));
            dt.Columns.Add("考评日期", typeof(string));
            dt.Columns.Add("考核用时", typeof(string));
            dt.Columns.Add("项目成绩", typeof(string));
            dt.Columns.Add("备注", typeof(string));

            dt.AcceptChanges();

            Expression<Func<ImpExamineReport, bool>> where = PredicateExtensionses.True<ImpExamineReport>();
            if (!string.IsNullOrEmpty(Request["StuName"]))
            {
                var stuName = Request["StuName"];
                where = where.And(m => m.StuName == stuName);
            }
            if (!string.IsNullOrEmpty(Request["IDCardNO"]))
            {
                var iDCardNO = Request["IDCardNO"];
                where = where.And(m => m.IDCardNO == iDCardNO);
            }
            DateTime trainStartDate;
            if (!string.IsNullOrEmpty(Request["TrainStartDate"]))
            {
                if (DateTime.TryParse(Request["TrainStartDate"], out trainStartDate))
                {
                    where = where.And(m => m.TrainStartDate >= trainStartDate);
                }
            }
            DateTime trainEndDate;
            if (!string.IsNullOrEmpty(Request["trainEndDate"]))
            {
                if (DateTime.TryParse(Request["TrainEndDate"], out trainEndDate))
                {
                    where = where.And(m => m.TrainEndDate <= trainEndDate);
                }
            }

            where = where.And(m => m.IsValid);

            var entitys = unitOfWork.ImpExamineReportBLL.GetEntitys(where).OrderBy(m => m.StuID);
            if (entitys != null && entitys.Any())
            {
                foreach (var entity in entitys)
                {
                    var row = dt.NewRow();

                    row["学员编号"] = entity.StuID;
                    row["姓名"] = entity.StuName;
                    row["培训单位"] = entity.TrainOffice;
                    row["身份证号"] = entity.IDCardNO;
                    row["考试岗位"] = entity.TrainPosition;
                    row["培训班名称"] = entity.TrainClassName;
                    row["培训开始时间"] = ConvertUtil.ConvertNullableDatetimeToString(entity.TrainStartDate);
                    row["培训结束时间"] = ConvertUtil.ConvertNullableDatetimeToString(entity.TrainEndDate);
                    row["考核项目编号"] = entity.ExamineProjectID;
                    row["考核项目名称"] = entity.ExamineProjectName;
                    row["考评员"] = entity.Assessor;
                    row["考评助理"] = entity.AssessorAssistant;
                    row["考评日期"] = ConvertUtil.ConvertNullableDatetimeToString(entity.ExamineDate);
                    row["考核用时"] = entity.ExaminTimeOffset;
                    row["项目成绩"] = ConvertUtil.ConvertNullableDecimalToString(entity.Score);
                    row["备注"] = entity.Remark;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #29
0
        public void Downloaddata()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-教室信息.xls";

            // 		楼层	房间号	房间名称	容量	备注
            var fieldsNames = new List<string>();
            fieldsNames.Add("楼层");
            fieldsNames.Add("房间号");
            fieldsNames.Add("房间名称");
            fieldsNames.Add("容量");
            fieldsNames.Add("备注");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("楼层", typeof(string));
            dt.Columns.Add("房间号", typeof(string));
            dt.Columns.Add("房间名称", typeof(string));
            dt.Columns.Add("容量", typeof(string));
            dt.Columns.Add("备注", typeof(string));
            dt.AcceptChanges();

            var entitys = unitOfWork.ClassRoomBLL.GetEntitys(m => m.IsValid);
            if (entitys != null && entitys.Any())
            {
                foreach (var classRoom in entitys)
                {
                    var row = dt.NewRow();
                    row["楼层"] = classRoom.FloorNo;
                    row["房间号"] = classRoom.RoomNo;
                    row["房间名称"] = classRoom.RoomName;
                    row["容量"] = classRoom.Volume;
                    row["备注"] = classRoom.Remark;
                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }
Example #30
0
        public void DownloaddataAnsys()
        {
            var exXls = new ExportXls();
            var filename = DateTime.Now.ToString("yyyy-MM-dd") + "-已培训人员信息.xls";

            var fieldsNames = new List<string>();
            fieldsNames.Add("路局");
            fieldsNames.Add("培训班");
            fieldsNames.Add("单位及职务");
            fieldsNames.Add("姓名");
            fieldsNames.Add("综合考核评分");

            var ds = new DataSet();
            var dt = new DataTable();

            dt.Columns.Add("路局", typeof (string));
            dt.Columns.Add("培训班", typeof (string));
            dt.Columns.Add("单位及职务", typeof (string));
            dt.Columns.Add("姓名", typeof (string));
            dt.Columns.Add("综合考核评分", typeof (string));
            dt.AcceptChanges();

            Expression<Func<ViewLujuTrainer, bool>> where = PredicateExtensionses.True<ViewLujuTrainer>();

            if (!string.IsNullOrEmpty(Request["BeginTime"]))
            {
                var beginTime = Convert.ToDateTime(Request["BeginTime"]);
                where = where.And(m => m.EndTime >= beginTime);
            }
            if (!string.IsNullOrEmpty(Request["EndTime"]))
            {
                var endTime = Convert.ToDateTime(Request["EndTime"]);
                where = where.And(m => m.EndTime <= endTime);
            }
            if (!string.IsNullOrEmpty(Request["Luju"]))
            {
                var luju = Request["Luju"];
                where = where.And(m => m.Luju.Contains(luju));
            }
            where = where.And(m => m.IsValid);
            var entitys = unitOfWork.ViewLujuTrainerBLL.GetEntitys(where).OrderBy(m => m.Luju).OrderBy(m=>m.ParentName);

            if (entitys != null && entitys.Any())
            {
                foreach (var student in entitys)
                {
                    var row = dt.NewRow();

                    row["路局"] = student.Luju;
                    row["培训班"] = student.ParentName;
                    row["单位及职务"] = student.DeptName;
                    row["姓名"] = student.Name;
                    row["综合考核评分"] = student.Score;

                    dt.Rows.Add(row);
                    dt.AcceptChanges();
                }
            }
            ds.Tables.Add(dt);
            exXls.ExportToXls(Response, fieldsNames, ds.Tables[0], filename);
        }