/// <summary> /// 绑定培训计划下的所有档案员 /// </summary> /// <param name="TrainPlanID">培训计划ID</param> /// <param name="isSelectAll">是否全选</param> /// <param name="firstSelectAll">第一次是否默认选中</param> public void DataBindEx(int TrainPlanID, bool isSelectAll, bool firstSelectAll) { T_Other_BLL bll = new T_Other_BLL(); DataSet ds = bll.GetTrainPlanToArchiveUser(TrainPlanID); if (ds != null && ds.Tables.Count > 0) { chk_ArchiveUserList.DataSource = ds; chk_ArchiveUserList.DataTextField = "UserName"; chk_ArchiveUserList.DataValueField = "COMPANYARCHIVEUSERID"; chk_ArchiveUserList.DataBind(); if (isSelectAll) { ListItem item = new ListItem("全部档案员", "0"); item.Attributes.Add("onclick", "SelectAll(this)"); chk_ArchiveUserList.Items.Insert(0, item); } if (firstSelectAll) { foreach (ListItem item in chk_ArchiveUserList.Items) { item.Selected = true; } } } }
protected void btnSave_Click(object sender, EventArgs e) { T_Construction_Project_BLL projectbll = new T_Construction_Project_BLL(); T_Construction_Project_MDL obj = new T_Construction_Project_MDL(); obj = ctrlConstructionBaseInfo1.GetModule(Common.ConvertEx.ToInt(Common.DNTRequest.GetQueryString("ID"))); //object obj = Comm.GetValueToObject(tmdl1, table1); int SingleProjectID = 0; if (obj != null) { T_Construction_Project_MDL newprojectmdl = (T_Construction_Project_MDL)obj; newprojectmdl.jgrq = DateTime.Now; if (((CommonEnum.PageState)ViewState["ps"]) == CommonEnum.PageState.ADD) { newprojectmdl.CompanyID = Common.ConvertEx.ToInt(Common.Session.GetSession("CompanyID")); //Leo 新增时,需要自动产生项目号 T_Other_BLL otherBLL = new T_Other_BLL(); newprojectmdl.xmh = otherBLL.GetNewProjectID(); SingleProjectID = projectbll.Add(newprojectmdl); PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_Construction_Project;key=", SingleProjectID, ";xmmc=", newprojectmdl.xmmc)); } else { projectbll.Update(newprojectmdl); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_Construction_Project;key=", newprojectmdl.ConstructionProjectID, ";xmmc=", newprojectmdl.xmmc)); } } Common.MessageBox.CloseLayerOpenWeb(this.Page); }
public void ExctFileList(string strFileListID, string strTitle, string strPsz, string strPsdd, string strPssj, string strOrderIndex) { try { int FileListId = ConvertEx.ToInt(strFileListID); if (FileListId > 0) { T_FileList_MDL model = fileListBLL.GetModel(FileListId); if (!model.IsFolder) { model.Title = strTitle; model.psz = strPsz; if (strPssj != "") { model.pssj = ConvertEx.ToDate(strPssj); } model.psdd = strPsdd; model.OrderIndex = ConvertEx.ToInt(strOrderIndex); model.CreateDate = System.DateTime.Now;//文件登记时间 fileListBLL.Update(model); T_Other_BLL otherBLL = new T_Other_BLL(); otherBLL.UpdateArchiveStatus(model.FileListID.ToString(), 10, "0"); } } } catch (Exception ex) { LogUtil.Debug(this, "文件登记归档目录保存操作", ex); } }
public void FileAccept(string fileListID, bool flag) { if (flag) { //验收通过 T_Other_BLL otherBLL = new T_Other_BLL(); otherBLL.UpdateArchiveStatus(fileListID, 20, "0"); } else { //验收不通过 T_Other_BLL otherBLL = new T_Other_BLL(); otherBLL.UpdateArchiveStatus(fileListID, 900, "0"); } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { DigiPower.Onlinecol.Standard.Model.T_FileList_MDL model = null; if (pageIndex != 1) { model = fileBLL.GetModel(Common.ConvertEx.ToInt(fileListID)); } else { model = fileBLL.GetModel(Common.ConvertEx.ToInt(ID)); } model = (Model.T_FileList_MDL)Comm.GetValueToObject(model, tbl); if (model != null && !model.IsFolder) { if (ConvertEx.ToInt(model.ManualCount) > 0) { if (model.wjgbdm == "ct" || model.wjgbdm == "yt" || model.wjgbdm == "dt" || model.wjgbdm == "lt") { model.tzz = ConvertEx.ToInt(model.ManualCount); } else { model.sl = ConvertEx.ToInt(model.ManualCount); } } model.qssj = DateTime.Now; model.zzsj = DateTime.Now; model.lrsj = DateTime.Now; model.shsj_1 = DateTime.Now; model.shsj_2 = DateTime.Now; model.shsj_3 = DateTime.Now; model.aipdate = DateTime.Now; model.pssj = DateTime.Now; model.CreateDate = DateTime.Now; model.Version = PublicModel.getFileVersion(model.SingleProjectID.ToString()); //获取文件的版本号 fileBLL.Update(model); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_FileList;key=", model.FileListID, ";SingleProjectID=", model.SingleProjectID, ";bh=", model.BH, ";Title=", model.Title)); T_Other_BLL otherBLL = new T_Other_BLL(); otherBLL.UpdateArchiveStatus(model.FileListID.ToString(), 10, "0"); } Common.MessageBox.CloseLayerOpenWeb(this.Page); }
private void BindGridView() { T_Other_BLL Bll = new T_Other_BLL(); #region 获得数据集 DataSet ds = new DataSet(); if (ViewState["sqlwhere"] != null && !String.IsNullOrEmpty(ViewState["sqlwhere"].ToString())) { string strSql = ViewState["sqlwhere"].ToString(); strSql = strSql.Replace("UserID", "Rec.UserID"); ds = Bll.GetTrainRec(strSql); } else if (!String.IsNullOrEmpty(SqlWhere)) { ds = Bll.GetTrainRec(SqlWhere); } else { ds = Bll.GetTrainRec("1=1"); } #endregion #region GridView中显示的字段名 List <string> ltFieldName = new List <string>(); ltFieldName.Add("Subject"); ltFieldName.Add("UserName"); ltFieldName.Add("COMPANYNAME"); ltFieldName.Add("PlanDate"); ltFieldName.Add("FinishDate"); #endregion #region 绑定GridView //ctrlGridEx1.PageCount = Common.ConvertEx.ToInt(Common.Session.GetSession("PageCount")); ctrlGridEx1.InitGrid("TrainRecID", ltFieldName, ds, "", true, false, ""); #endregion }
void BindGrid() { _CompanyID = Common.ConvertEx.ToInt(Common.DNTRequest.GetString("CompanyID")); T_Company_MDL objCompany = (new T_Company_BLL()).GetModel(_CompanyID); T_SystemInfo_MDL objSystemInfo = (new T_SystemInfo_BLL()).GetModel(objCompany.CompanyType); T_Other_BLL otherBLL = new T_Other_BLL(); DataSet ds = otherBLL.GetCompanySignet(_CompanyID, objSystemInfo.SystemInfoCode); List <GridExPara> collist = new List <GridExPara>(); GridExPara p11 = new GridExPara(); p11.FieldName = "AttachID"; p11.bShow = false; collist.Add(p11); GridExPara p1 = new GridExPara(); p1.FieldName = "SystemInfoName"; collist.Add(p1); GridExPara p2 = new GridExPara(); p2.FieldName = "SubType"; collist.Add(p2); GridExPara p3 = new GridExPara(); p3.FieldName = "AttachPath"; p3.iType = GridExPara.CtrlType.Image; p3.iLength = 120; collist.Add(p3); GridExPara p99 = new GridExPara(); p99.FieldName = ""; p99.iType = GridExPara.CtrlType.FileUpload; collist.Add(p99); //ctrlGridEx1.PageCount = Common.ConvertEx.ToInt(Common.Session.GetSession("PageCount")); ctrlGridEx1.InitGrid("SystemInfoID", collist, ds, "", false, false, ""); }
//删除 protected void btnDelete_Click(object sender, EventArgs e) { List <string> keyList = ctrlGridEx1.GetSelects();//获取Gridview选中行的主键集合 if (keyList.Count > 0) { for (int i = 0; i < keyList.Count; i++) { DataSet ds = new T_Other_BLL().GetTrainPlanToArchiveUser(Common.ConvertEx.ToInt(keyList[i])); if (ds != null && ds.Tables[0].Rows.Count > 0) { Common.MessageBox.Show(this, "该培训计划已经有档案员参加,如要删除必须先删除档案员的培训记录!"); return; } new T_Train_Plan_BLL().Delete(Common.ConvertEx.ToInt(keyList[i])); } BindGridView(); } }
/// <summary> /// 绑定接收审核信息 /// </summary> /// <param name="SingleProjectID"></param> public void DataBindEx(string SingleProjectID, string WorkFlowCode) { DataTable dt = new T_WorkFlowDefine_BLL().GetWrokFlowCheckInfo(SingleProjectID, WorkFlowCode).Tables[0]; if (dt != null && dt.Rows.Count > 0) { SubmitUser_dash.Text = ConvertEx.ToString(dt.Rows[0]["P_SubmitUserName"]); SubmitDateTime_dash.Text = ConvertEx.ToDate(dt.Rows[0]["P_SubmitDateTime"]).ToString("yyyy-MM-dd"); RecvUser_dash.Text = ConvertEx.ToString(dt.Rows[0]["RecvUserName"]); RecvDateTime_dash.Text = ConvertEx.ToDate(dt.Rows[0]["RecvDateTime"]).ToString("yyyy-MM-dd"); DataSet ds = new T_Other_BLL().GetArchiveInfo(Common.DNTRequest.GetQueryString("SingleProjectID")); if (ds.Tables.Count > 0) { DataTable table = ds.Tables[0]; ArchiveCount.Text = Common.ConvertEx.ToString(table.Rows[0]["archiveCount"]); //案卷个数 wz.Text = Common.ConvertEx.ToString(table.Rows[0]["wz"]); //文字 tzz.Text = Common.ConvertEx.ToString(table.Rows[0]["tzz"]); //图纸层 zp.Text = Common.ConvertEx.ToString(table.Rows[0]["zp"]); //照片 hh.Text = Common.ConvertEx.ToString(table.Rows[0]["hh"]); //混合 } } }
/// <summary> /// 绑定接收审核信息 /// </summary> /// <param name="SingleProjectID"></param> public void DataBindEx(string SingleProjectID) { List <T_WorkFlowDefine_MDL> ltWorkFlowDefine2 = new T_WorkFlowDefine_BLL().GetModelList("SingleProjectID=" + SingleProjectID + " AND WorkFlowID=(select WorkFlowID from T_WorkFlow where WorkFlowCode='CHECK')"); if (ltWorkFlowDefine2.Count > 0) { SubmitUser_dash.Text = GetUserName(Common.ConvertEx.ToInt(ltWorkFlowDefine2[0].SubmitUserID)); SubmitDateTime_dash.Text = Common.ConvertEx.ToDate(ltWorkFlowDefine2[0].SubmitDateTime).ToString("yyyy-MM-dd"); RecvUser_dash.Text = GetUserName(Common.ConvertEx.ToInt(ltWorkFlowDefine2[0].RecvUserID)); RecvDateTime_dash.Text = Common.ConvertEx.ToDate(ltWorkFlowDefine2[0].RecvDateTime).ToString("yyyy-MM-dd"); DataSet ds = new T_Other_BLL().GetArchiveInfo(Common.DNTRequest.GetQueryString("SingleProjectID")); if (ds.Tables.Count > 0) { DataTable table = ds.Tables[0]; ArchiveCount.Text = Common.ConvertEx.ToString(table.Rows[0]["archiveCount"]); //案卷个数 wz.Text = Common.ConvertEx.ToString(table.Rows[0]["wz"]); //文字卷数 tzz.Text = Common.ConvertEx.ToString(table.Rows[0]["tzz"]); //图纸卷数 zp.Text = Common.ConvertEx.ToString(table.Rows[0]["zp"]); //照片卷数 hh.Text = Common.ConvertEx.ToString(table.Rows[0]["hh"]); //混合卷数 } } }
public string AllotSingleProject(string SingleProjectID, string ChargeUserID, string WorkFlowID) { try { //激活工程 T_SingleProject_MDL singleProjectMDL = singleProjectBLL.GetModel(ConvertEx.ToInt(SingleProjectID)); singleProjectMDL.Status = 1; int CompanyID = 0; #region 没有工程编号则生成 if (String.IsNullOrEmpty(singleProjectMDL.gcbm)) { T_Other_BLL otherBLL = new T_Other_BLL(); singleProjectMDL.gcbm = otherBLL.GetNewEngineerID(); singleProjectBLL.Update(singleProjectMDL); //产生工程号 T_Construction_Project_BLL cpBLL = new T_Construction_Project_BLL(); Model.T_Construction_Project_MDL cpMDL = cpBLL.GetModel(singleProjectMDL.ConstructionProjectID); if (cpMDL != null) { CompanyID = cpMDL.CompanyID; //建设单位ID if (String.IsNullOrEmpty(cpMDL.xmh)) { cpMDL.xmh = otherBLL.GetNewProjectID(); cpBLL.Update(cpMDL); //更新项目号 } } } #endregion #region 激活用户 T_UsersInfo_BLL userBLL = new T_UsersInfo_BLL(); T_UsersInfo_MDL userMDL = userBLL.GetModel(singleProjectMDL.CompanyUserID); if (userMDL != null) { userMDL.IsValid = true; userBLL.Update(userMDL); } #endregion #region 修改工程分配信息 if (singleProjectMDL != null) { singleProjectMDL.AllotDate = DateTime.Now; //分配时间 singleProjectMDL.AllotUserID = ConvertEx.ToInt(Common.Session.GetSession("UserId")); //分配人员 singleProjectMDL.ChargeUserID = ConvertEx.ToInt(ChargeUserID); //业务指导人员 singleProjectBLL.Update(singleProjectMDL); } #endregion #region 添加建设单位归档目录 string iSignaturePdf = "0"; //文件是否需要签章 string iSignatureWorkFlow = "0"; //是否按签章流程签章 if (ConvertEx.ToBool(SystemSet._ISIGNATUREPDF)) { iSignaturePdf = "1"; iSignatureWorkFlow = "1"; } new UserOperate().CopyFileList(CompanyID, singleProjectMDL.CompanyUserID, "", singleProjectMDL.SingleProjectID, singleProjectMDL.ProjectType, iSignaturePdf, iSignatureWorkFlow); #endregion #region 把业务指导人员用户加入到这个工程用户中去 T_UsersInfo_MDL ChargeUserMDL = userBLL.GetModel(Common.ConvertEx.ToInt(ChargeUserID)); PublicModel.AddSingleProjectUser(singleProjectMDL.SingleProjectID, ChargeUserMDL); #endregion #region 相关流程的用户也需要加入,否则流程走不下去===现在有了受理,可以达到这个功能,不需要加了。让用户受理下来。受理还没做完呢? SingleProjectUser projectRole = new SingleProjectUser(); BLL.T_WorkFlow_BLL workFlowBLL = new T_WorkFlow_BLL(); DataSet workFlowDS = workFlowBLL.GetList(" OrderIndex=1 "); if (workFlowDS.Tables.Count > 0) { foreach (DataRow row in workFlowDS.Tables[0].Rows) { projectRole.Update(singleProjectMDL.SingleProjectID, Common.ConvertEx.ToInt(row["RoleID"]), Common.ConvertEx.ToInt(row["UserID"])); } } #endregion #region 发送邮件通知客户 if (SystemSet._ACCEPTSINGLE_SENDEMAILFLAG) { string strMsgBody = "您好!<br />"; strMsgBody += "您报建的工程:" + singleProjectMDL.gcmc + ",已确认通过,产生的工程编号是:" + singleProjectMDL.gcbm + ",您现在已经可以通过注册时的账号密码登记系统操作了!"; T_UsersInfo_MDL CompanyUserMDL = userBLL.GetModel(singleProjectMDL.CompanyUserID); Common.CSendEmail.SendEmail("档案馆", CompanyUserMDL.EMail, "工程报建确认通知", strMsgBody, ""); } #endregion #region 提交到下一个流程 WorkFlowManage workflowmanage = new WorkFlowManage(); workflowmanage.GoNextProjectWorkFlowSataus(singleProjectMDL.SingleProjectID, ConvertEx.ToInt(WorkFlowID)); #endregion #region 将指导人员指导环节的所有 [受理]全部 做,这样,除了管理员和受理人员外,其他人都看不到流程下的工程 T_WorkFlowDefine_BLL workFlowDefineBLL = new T_WorkFlowDefine_BLL(); IList <T_WorkFlowDefine_MDL> workFlowDefineLT = workFlowDefineBLL.GetModelList(" SingleProjectID=" + singleProjectMDL.SingleProjectID + " and WorkFlowID in(" + SystemSet._DEFAULT_RECV_WORKFLOWID + ") "); if (workFlowDefineLT != null && workFlowDefineLT.Count > 0) { foreach (T_WorkFlowDefine_MDL wkdMDL in workFlowDefineLT) { wkdMDL.SubmitStatus = 2;//受理完成状态 wkdMDL.RecvUserID = Common.ConvertEx.ToInt(ChargeUserID); wkdMDL.RecvDateTime = DateTime.Now; workFlowDefineBLL.Update(wkdMDL); } } #endregion return(singleProjectMDL.gcbm); } catch (Exception ex) { return(SystemSet._RETURN_FAILURE_VALUE + ex.Message); } }
/// <summary> /// 根据工程ID 将报表导出PDF,注意:报表必须预先在T_Report做出记录 , /// 新生成的报表PDF文件名: pdfFileName=String.Concat(SingleProjectID, "-", ReportCode, ".pdf"); /// 报表PDF存放路径: Server.MapPath("../Upload/TempReport/" + pdfFileName /// </summary> /// <param name="ids">ids 工程id或案卷id</param> /// <param name="reportCode">报表类型</param> /// <param name="delOldReportPdf">是否删除已生成的PDF,删除则重新生成</param> /// <returns></returns> public static string ReportExportPDF(string ids, string reportCode, bool delOldReportPdf) { string pdfFileName = String.Concat(ids, "-", reportCode, ".pdf"); try { if (System.IO.File.Exists(HttpContext.Current.Server.MapPath("../Upload/TempReport/" + pdfFileName))) { if (delOldReportPdf) { System.IO.File.Delete(HttpContext.Current.Server.MapPath("../Upload/TempReport/" + pdfFileName)); } else { return(pdfFileName); } } List <T_Report_MDL> ltReport = new T_Report_BLL().GetModelList("lower(ReportCode)='" + reportCode.ToLower() + "'"); if (ltReport == null || ltReport.Count < 1) { return(SystemSet._RETURN_FAILURE_VALUE + "报表数据不存在!"); } T_Report_MDL trMdl = ltReport[0]; T_Report_Type_MDL trtMdl = new T_Report_Type_BLL().GetModel(Common.ConvertEx.ToInt(trMdl.ReportTypeID)); if (trMdl == null || trtMdl == null) { return(SystemSet._RETURN_FAILURE_VALUE + "报表数据不存在!"); } if (!Directory.Exists(HttpContext.Current.Server.MapPath("../ajax"))) //如果不用报表空间预先加载报表,必须先创建此目录 { Directory.CreateDirectory(HttpContext.Current.Server.MapPath("../ajax")); } if (!Directory.Exists(HttpContext.Current.Server.MapPath("../Upload/TempReport/")))//存放报表PDF的临时目录 { Directory.CreateDirectory(HttpContext.Current.Server.MapPath("../Upload/TempReport/")); } string reportPath = HttpContext.Current.Server.MapPath("../Report/ReportFiles/" + trtMdl.ReportTypeName + "/" + trMdl.ReportFilePath); if (System.IO.File.Exists(reportPath)) { StiReport Report = new StiReport(); Report.Load(reportPath);//加载报表 DataSet ds = new DataSet(); if (reportCode.ToLower() == "zrs") { string strSql = "select a.*,b.ReadyCheckBookCode from T_SingleProject a inner join T_ReadyCheckBook b "; strSql += "on a.SingleProjectID=b.SingleProjectID where a.SingleProjectID=" + ids + " "; ds = new T_Other_BLL().GetDataSet(strSql); } else if (reportCode.ToLower() == "rkz") { string strSql = "select a.*,b.ReadyCheckBookCode from T_SingleProject a inner join T_ReadyCheckBook b "; strSql += "on a.SingleProjectID=b.SingleProjectID where a.SingleProjectID=" + ids + " "; ds = new T_Other_BLL().GetDataSet(strSql); } else if (reportCode.ToLower() == "zms") { string strSql = "select P.gcbm,P.jsdw,P.gcmc,P.ghxkzh,P.gcdd,P.sgxkzh," + " (CASE P.ProjectType WHEN 1 then P1.jzmj WHEN 2 THEN P2.jzmj WHEN 3 THEN '' END) AS JZMJ, " + " (CASE P.ProjectType WHEN 1 then P1.gcjs WHEN 2 THEN P2.zjs WHEN 3 THEN '' END) AS gczj, " + " P.kgsj,P.jgsj from T_SingleProject P " + " LEFT JOIN a_single_project P1 ON P.SingleProjectID=P1.SingleProjectID" + " LEFT JOIN b_single_project P2 ON P.SingleProjectID=p2.SingleProjectID" + " WHERE P.SingleProjectID=" + ids; T_Other_BLL otherBLL = new T_Other_BLL(); ds = otherBLL.GetDataSet(strSql); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { ds.Tables[0].Columns.Add(new DataColumn("wzCount")); //文字卷数 ds.Tables[0].Columns.Add(new DataColumn("tzCount")); //图纸卷数 } ds = new T_Other_BLL().GetDataSet(strSql); } else if (reportCode.ToLower() == "archivefengpi") { string strSql = "SELECT DH,ShortDH,AJTM,BZDW,lrsj,zzsj,t_systeminfo.systeminfoname as sys_mj,sys2.systeminfoname as sys_bgqx,XH,"; strSql += "(SELECT COUNT(0) FROM T_Archive WHERE SINGLEPROJECTID=T_Archive.SINGLEPROJECTID) as jzcs, "; strSql += "(select SUM(isnull(ManualCount,0)) from t_filelist where t_filelist.ArchiveID=T_Archive.ArchiveID)as TotalPageNums "; strSql += "FROM T_Archive left join t_systeminfo on t_archive.mj=t_systeminfo.systeminfoid left join t_systeminfo sys2 "; strSql += "on t_archive.bgqx=sys2.systeminfoid WHERE ARCHIVEID=" + ids; ds = new T_Other_BLL().GetDataSet(strSql); } else if (reportCode.ToLower() == "archivemulu") { string strSql = "select (ROW_NUMBER() over (PARTITION by ArchiveID ORDER BY OrderIndex)) as RowID,archiveid, "; strSql += "w_t_h,Title,zrr,lrsj,StartTime,PagesCount,ManualCount,yc "; strSql += "from t_filelist where archiveid in(" + ids + ") Order by ArchiveID,OrderIndex asc "; ds = new T_Other_BLL().GetDataSet(strSql); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) //重排页次 { DataTable dt = ds.Tables[0]; int PageIndexCount = 1; for (var i = 0; i < dt.Rows.Count; i++) { if (i == 0) { dt.Rows[i]["PagesCount"] = PageIndexCount; dt.Rows[i]["yc"] = PageIndexCount; } else { if ((i + 1) < dt.Rows.Count && ConvertEx.ToInt(dt.Rows[i]["archiveid"]) != ConvertEx.ToInt(dt.Rows[i - 1]["archiveid"])) { PageIndexCount = 1; } else { PageIndexCount += ConvertEx.ToInt(dt.Rows[i - 1]["ManualCount"]); } dt.Rows[i]["PagesCount"] = PageIndexCount; dt.Rows[i]["yc"] = PageIndexCount; if (((i + 1) < dt.Rows.Count && ConvertEx.ToInt(dt.Rows[i]["archiveid"]) != ConvertEx.ToInt(dt.Rows[i + 1]["archiveid"])) || (i + 1) >= dt.Rows.Count) { int lastManualCount = ConvertEx.ToInt(dt.Rows[i]["ManualCount"]);//每个案卷中的最后一份文件页次都是 *-*格式 if (lastManualCount > 1) { dt.Rows[i]["yc"] = string.Concat(ConvertEx.ToInt(dt.Rows[i]["PagesCount"]), "-", ConvertEx.ToInt(dt.Rows[i]["PagesCount"]) - 1 + lastManualCount); } else if (lastManualCount == 1) { dt.Rows[i]["yc"] = string.Concat(dt.Rows[i]["yc"], "-", dt.Rows[i]["yc"]); } } } } } } else if (reportCode.ToLower() == "juanneibeikao") { string strSql = "select T_Archive.lrr,T_Archive.lrsj,T_Archive.shr,T_Archive.shsj,sum(isnull(manualcount,0)) wzz, "; strSql += "sum(isnull(t_filelist.tzz,0)) tzz,sum(isnull(zpz,0)) zpz,T_Archive.note from t_filelist,T_Archive where "; strSql += "t_filelist.ArchiveID=T_Archive.ArchiveID AND t_filelist.archiveid=" + ids + " group by T_Archive.lrr,"; strSql += " T_Archive.shr,T_Archive.note,T_Archive.lrsj,T_Archive.shsj"; ds = new T_Other_BLL().GetDataSet(strSql); } else if (reportCode.ToLower() == "printarchive") { string strSql = "select w_t_h,Title,zrr,lrsj,StartTime,PagesCount from t_filelist where Status<>0 AND "; strSql += "SingleProjectID=" + ids + " Order by bh "; ds = new T_Other_BLL().GetDataSet(strSql); } if (ds != null && ds.Tables.Count > 0) { Report.RegData("Report", ds); Report.Render(false); Report.ExportDocument(StiExportFormat.Pdf, HttpContext.Current.Server.MapPath("../Upload/TempReport/" + pdfFileName)); } else { pdfFileName = SystemSet._RETURN_FAILURE_VALUE + "无数据,不用打印!"; } } else { pdfFileName = SystemSet._RETURN_FAILURE_VALUE + "报表模板文件不存在!"; } } catch (Exception ex) { pdfFileName = SystemSet._RETURN_FAILURE_VALUE + ex.Message; } return(pdfFileName); }
protected void Page_Load(object sender, EventArgs e) { Ajax.Utility.RegisterTypeForAjax(typeof(SubmittedInfo)); singleProjectID = DNTRequest.GetQueryString("singleProjectID"); //工程ID reportType = DNTRequest.GetQueryString("reportType"); //报表类型 if (!IsPostBack) { T_SingleProject_MDL singMDL = singleBLL.GetModel(ConvertEx.ToInt(singleProjectID)); if (singMDL != null) { ReadyCheckBookCode.Text = singMDL.gcbm; jsdw.Text = singMDL.jsdw; } if (string.Compare(reportType, "rkz", true) == 0) { //ltTitle.Text = SystemSet._APPAREA + "建设工程档案认可意见书"; ltReadyCheckBookCode.Text = "预验收编号:"; ReadyCheckBookCode.labelTitle = ltReadyCheckBookCode.Text; TableRowShow(7, Table1.Rows.Count); } else if (string.Compare(reportType, "zms", true) == 0) { //ltTitle.Text = SystemSet._APPAREA + "建设工程档案移交证明书"; ltReadyCheckBookCode.Text = "验收编号:"; ReadyCheckBookCode.labelTitle = ltReadyCheckBookCode.Text; TableRowShow(2, 7); } else if (string.Compare(reportType, "zrs", true) == 0) { //ltTitle.Text = SystemSet._APPAREA + "建设工程档案移交证明书"; ltReadyCheckBookCode.Text = "责任书编号:"; ReadyCheckBookCode.labelTitle = ltReadyCheckBookCode.Text; TableRowShow(2, Table1.Rows.Count); } string strWhere = "SingleProjectID='" + singleProjectID + "' and lower(CodeType)='" + reportType.ToLower() + "'"; IList <T_ReadyCheckBook_MDL> ltMdl = readBLL.GetModelList(strWhere); if (ltMdl != null && ltMdl.Count > 0) { T_ReadyCheckBook_MDL readMDL = ltMdl[0]; txtTotalScroll.Text = ConvertEx.ToString(readMDL.TOTAL_SCROLL); txtCharacterScroll.Text = ConvertEx.ToString(readMDL.CHARACTER_SCROLL); txtPicScroll.Text = ConvertEx.ToString(readMDL.PIC_SCROLL); txtPhotoPageCount.Text = ConvertEx.ToString(readMDL.PHOTO_COUNT); txtRadioCount.Text = ConvertEx.ToString(readMDL.RADIO_COUNT); txtOtherMaterial.Text = readMDL.OTHER_MATERIAL; txtDirectoryScroll.Text = ConvertEx.ToString(readMDL.Directory_SCROLL); txtDirectoryPage.Text = ConvertEx.ToString(readMDL.Directory_PAGE_COUNT); ReadyCheckBookCode.Text = readMDL.ReadyCheckBookCode; jsdwfzr_Name.Text = readMDL.jsdwfzr_Name; jsdwfzr_Tel.Text = readMDL.jsdwfzr_Tel; ArchiveUserName.Text = readMDL.ArchiveUserName; ArchiveUser_Tel.Text = readMDL.ArchiveUser_Tel; ViewState["objModel"] = readMDL; } else { DataSet ds = new T_Other_BLL().GetArchiveInfo(singleProjectID); if (ds.Tables.Count > 0) { DataTable table = ds.Tables[0]; txtTotalScroll.Text = Common.ConvertEx.ToString(table.Rows[0]["archiveCount"]); //案卷总卷数 txtCharacterScroll.Text = Common.ConvertEx.ToString(table.Rows[0]["wz"]); //文字 卷数 txtPicScroll.Text = Common.ConvertEx.ToString(table.Rows[0]["tzz"]); //图纸 卷数 } } } }
protected override void CreateChildControls() { if (Session["ReportCode"] != null) { ReportCode = Session["ReportCode"].ToString(); } else { return; } T_Search_Field_BLL tsfBll = new T_Search_Field_BLL(); DataTable dt1 = tsfBll.GetList("ReportCode='" + ReportCode + "' order by OrderId asc ").Tables[0]; if (dt1 != null && dt1.Rows.Count > 0) { int LastLine = 0; for (int i1 = 0; i1 < dt1.Rows.Count; i1++) { DataRow r1 = dt1.Rows[i1]; Panel panel1 = new Panel(); panel1.Style.Add("float", "left"); //panel1.Style.Add("clear", "right"); panel1.Style.Add("padding-left", "2px"); panel1.Style.Add("padding-right", "2px"); panel1.Style.Add("margin-left", "2px"); panel1.Style.Add("margin-right", "2px"); //panel1.Style.Add("border-bottom", "1px dashed"); //panel1.Style.Add("border-left", "1px dashed"); //panel1.Style.Add("height", "23px"); //panel1.Style.Add("width", "250px"); //panel1.Style.Add("width", "1px"); if (i1 > 0 && LastLine.ToString() != r1["Line"].ToString()) { panel1.Style.Add("float", "left"); panel1.Style.Add("clear", "left"); } LastLine = Common.ConvertEx.ToInt(r1["Line"].ToString()); Label l1 = new Label(); l1.Text = r1["LabelName"].ToString() + " "; panel1.Controls.Add(l1); //AddSpace(ref panel1); DataTable dt2 = new T_Search_Para_BLL().GetList("Search_Field_ID=" + r1["Search_Field_ID"].ToString() + " order by OrderId asc ").Tables[0]; if (dt2 != null && dt2.Rows.Count > 0) { for (int K1 = 0; K1 < dt2.Rows.Count; K1++) { DataRow r2 = dt2.Rows[K1]; //宽 //panel1.Style.Add("width", int.Parse(r2["ControlWidth"].ToString()) * dt2.Rows.Count + l1.Text.Length * 20 + "px"); if (r2["ParaType"].ToString() == "TextBox" || r2["ParaType"].ToString() == "DateTime") { TextBox txt1 = new TextBox(); txt1.ID = r1["TableName"].ToString() + "|" + r1["FieldName"].ToString() + "|" + r1["Search_Field_ID"].ToString() + "|" + r2["Search_Para_ID"].ToString(); txt1.Text = r2["DefaultValue"].ToString(); if (r2["ControlWidth"] != null) { txt1.Width = Unit.Parse(r2["ControlWidth"].ToString()); } if (r2["ParaType"].ToString() == "DateTime") { //if (r2["DefaultValue"].ToString() == "1")//月初 //{ // DateTime firstDay = new DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, 1); // txt1.Text = firstDay.ToString("yyyy-MM-dd"); //} //else if (r2["DefaultValue"].ToString() == "2")//当前日期 //{ // txt1.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); //} txt1.Text = DateTime.Now.ToString("yyyy-MM-dd"); txt1.Attributes.Add("onblur", "return CheckValid(this,'','Date');"); txt1.Attributes.Add("onclick", "new Calendar().show(this);"); } panel1.Controls.Add(txt1); AddSpace(ref panel1, K1, dt2.Rows.Count); } else if (r2["ParaType"].ToString() == "ComboBox") { DropDownList txt1 = new DropDownList(); txt1.ID = r1["TableName"].ToString() + "|" + r1["FieldName"].ToString() + "|" + r1["Search_Field_ID"].ToString() + "|" + r2["Search_Para_ID"].ToString(); if (r2["ControlWidth"] != null) { txt1.Width = Unit.Parse(r2["ControlWidth"].ToString()); } string SourceSql = r2["SourceSql"].ToString(); DataTable sourceDt = new T_Other_BLL().GetDataSet(SourceSql).Tables[0]; txt1.Items.Add("");//增加空 for (int J1 = 0; J1 < sourceDt.Rows.Count; J1++) { ListItem listitem2 = new ListItem(sourceDt.Rows[J1][1].ToString(), sourceDt.Rows[J1][0].ToString()); txt1.Items.Add(listitem2); } panel1.Controls.Add(txt1); AddSpace(ref panel1, K1, dt2.Rows.Count); } } } this.CurrentPanel.Controls.Add(panel1); } } base.CreateChildControls(); }