예제 #1
0
        /// <summary>
        /// 获取卷宗列表
        /// </summary>
        /// <param name="pageIndex">页数</param>
        /// <param name="pageSize">每页有多少行</param>
        /// <param name="planName">预案名称</param>
        /// <param name="createTime">创建时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns></returns>
        public ActionResult GetDossierList(int pageIndex, int pageSize, string archiveName, int archiveType, int archiveStatus, string createTime, string endTime)
        {
            ServArchiveInfoQuery archiveInfoQuery = new ServArchiveInfoQuery();

            if (archiveName != "")
            {
                archiveInfoQuery.archive_name = archiveName;
            }
            archiveInfoQuery.archive_status = archiveStatus;
            archiveInfoQuery.report_type    = archiveType;
            if (createTime != "")
            {
                archiveInfoQuery.create_time = createTime;
            }
            if (endTime != "")
            {
                archiveInfoQuery.Endtime = endTime;
            }
            int totalNumber = 0;
            List <ArchiveInfo> archiveInfoList = new List <ArchiveInfo>();

            try
            {
                archiveInfoList = servArchiveInfoBLL.GetEntities(archiveInfoQuery, pageIndex, pageSize, out totalNumber);
                var temp = new { total = totalNumber, rows = archiveInfoList.OrderByDescending(n => n.id).ToList() };
                return(Json(new { status = 0, msg = temp }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { status = 1, msg = ex.Message }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #2
0
 /// <summary>
 /// 分页查询获取卷宗信息
 /// </summary>
 /// <param name="servDevicePlanQuery"></param>
 /// <param name="pageSize">每页记录数</param>
 /// <param name="pageNumber">当前页码</param>
 /// <param name="totalNumber">共多少条</param>
 /// <returns></returns>
 public List <ArchiveInfo> GetEntities(ServArchiveInfoQuery servArchiveInfoQuery, int pageNumber, int pageSize, out int totalNumber)
 {
     try
     {
         List <ServArchiveInfoModel> archivelist     = new List <ServArchiveInfoModel>();
         List <ArchiveInfo>          archiveInfoList = new List <ArchiveInfo>();
         archivelist = servArchiveInfoDAL.GetEntities(servArchiveInfoQuery, pageNumber, pageSize, out totalNumber);
         ArchiveInfo archiveInfoModel;
         foreach (ServArchiveInfoModel item in archivelist)
         {
             archiveInfoModel                    = new ArchiveInfo();
             archiveInfoModel.id                 = item.id;
             archiveInfoModel.archive_num        = item.archive_num;
             archiveInfoModel.archive_name       = item.archive_name;
             archiveInfoModel.create_time        = item.create_time;
             archiveInfoModel.update_time        = item.update_time;
             archiveInfoModel.archive_decription = item.archive_decription;
             archiveInfoModel.report_person      = item.report_person;
             archiveInfoModel.archive_status     = item.archive_status;
             //获取卷宗类别类型
             var u = baseReportTypeDAL.GetEntity(item.report_type);
             archiveInfoModel.report_name = u == null ? "未知" : u.type_name;
             //创建人
             var a = servPersonInfoDAL.GetPersonInfoBySSOId(item.create_persson_id);
             archiveInfoModel.create_name = a == null ? "未知" : a.alias;
             archiveInfoModel.status_name = Enum.GetName(typeof(EnumClass.ArchiveStatus), item.archive_status);
             archiveInfoList.Add(archiveInfoModel);
         }
         return(archiveInfoList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
        /// <summary>
        /// 结案
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool modifyArchiveState(int id, string archiveStatus)
        {
            try
            {
                ServArchiveInfoQuery servArchiveInfo = new ServArchiveInfoQuery();
                servArchiveInfo.id = id;
                if (archiveStatus == "结案")
                {
                    servArchiveInfo.archive_status = (int)CSM.Common.EnumClass.ArchiveStatus.结案;
                }
                else if (archiveStatus == "废止")
                {
                    servArchiveInfo.archive_status = (int)CSM.Common.EnumClass.ArchiveStatus.废止;
                }

                bool result = servArchiveInfoDAL.modifyArchiveState(servArchiveInfo);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #4
0
        /// <summary>
        /// 导出卷宗信息
        /// </summary>
        /// <param name="result_id"></param>
        /// <param name="archiveName"></param>
        /// <param name="archiveType"></param>
        /// <param name="archiveState"></param>
        /// <param name="starteTime"></param>
        /// <param name="endtTime"></param>
        /// <returns></returns>
        public System.IO.MemoryStream GetAllExportArchiveExcel(string result_id, string archiveName, int archiveType, int archiveState, string starteTime, string endtTime)
        {
            List <ArchiveInfo> retList = new List <ArchiveInfo>();

            #region   拼接DataTable列头
            System.Data.DataTable table = new System.Data.DataTable();
            table.Columns.Add("卷宗编号");
            table.Columns.Add("卷宗名称");
            table.Columns.Add("卷宗类别");
            table.Columns.Add("卷宗创建人");
            table.Columns.Add("报案人");
            table.Columns.Add("卷宗描述");
            table.Columns.Add("创建时间");
            table.Columns.Add("修改时间");
            table.Columns.Add("卷宗状态");
            #endregion
            try
            {
                List <ServArchiveInfoModel> list = new List <ServArchiveInfoModel>();
                if (result_id != "")
                {
                    list = servArchiveInfoDAL.GetArchiveInfo(result_id);
                }
                else
                {
                    ServArchiveInfoQuery archiveInfoQuery = new ServArchiveInfoQuery();
                    if (archiveName != "")
                    {
                        archiveInfoQuery.archive_name = archiveName;
                    }
                    archiveInfoQuery.archive_status = archiveState;
                    archiveInfoQuery.report_type    = archiveType;
                    if (starteTime != "")
                    {
                        archiveInfoQuery.create_time = starteTime;
                    }
                    if (endtTime != "")
                    {
                        archiveInfoQuery.Endtime = endtTime;
                    }
                    list = servArchiveInfoDAL.GetAllArchive(archiveInfoQuery);
                }
                if (list != null)
                {
                    foreach (ServArchiveInfoModel model in list)
                    {
                        System.Data.DataRow row = table.NewRow();
                        row["卷宗编号"] = model.archive_num;
                        row["卷宗名称"] = model.archive_name;
                        //获取卷宗类别类型
                        var u = baseReportTypeDAL.GetEntity(model.report_type);
                        row["卷宗类别"] = u == null ? "未知" : u.type_name;
                        //创建人
                        var a = servPersonInfoDAL.GetPersonInfoBySSOId(model.create_persson_id);
                        row["卷宗创建人"] = a == null ? "未知" : a.alias;
                        row["报案人"]   = model.report_person;
                        row["卷宗描述"]  = model.archive_decription;
                        row["创建时间"]  = model.create_time.ToString();
                        row["修改时间"]  = model.update_time.ToString();
                        row["卷宗状态"]  = Enum.GetName(typeof(EnumClass.ArchiveStatus), model.archive_status);
                        table.Rows.Add(row);
                    }
                }
                System.IO.MemoryStream ms = CSM.Utils.ExcelHelper.DataTableToExcel(table, "sheet2");
                return(ms);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }