protected void btnSave_Click(object sender, EventArgs e) { if (ViewState["userMDL"] != null) { T_UsersInfo_MDL userMDL = ViewState["userMDL"] as T_UsersInfo_MDL; userMDL.UserName = UserName.Text; userMDL.Mobile = Mobile.Text; userMDL.Fax = Fax.Text; userMDL.Tel = Tel.Text; userMDL.Passwd = DESEncrypt.Encrypt(newPasswd2.Text); userinfoBLL.Update(userMDL); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat(" T_UsersInfo;key=", userMDL.UserID, ";UserName="******";LoginName=", userMDL.LoginName, ";ChangePassword.aspx密码重置")); if (ViewState["companyMDL"] != null) { T_Company_MDL companyMDL = ViewState["companyMDL"] as T_Company_MDL; companyMDL.CompanyName = CompanyName.Text.Trim(); companyBLL.Update(companyMDL); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat(" T_Company_MDL;key=", companyMDL.CompanyID, ";CompanyName=", companyMDL.CompanyName, ";ChangePassword.aspx管理员更新档案馆名称")); } Common.MessageBox.FnLayerAlert(this.Page, "保存成功,新密码重新登录才有效!"); } }
public string DeleteCompany(string CompanyID) { string flag = SystemSet._RETURN_SUCCESS_VALUE; try { T_Company_MDL companyMDL = compBLL.GetModel(ConvertEx.ToInt(CompanyID)); if (companyMDL != null) { T_SystemInfo_BLL systemInfoBLL = new T_SystemInfo_BLL(); if (companyMDL != null && companymdl.CompanyType != SystemSet._JSCOMPANYINFO) //只删除监理和施工 { compBLL.DeleteCompanyOther(CompanyID); PublicModel.writeLog(SystemSet.EumLogType.DelData.ToString(), string.Concat("T_Company;key=", companyMDL.CompanyID, ";CompanyCode=", companyMDL.CompanyCode, ";CompanyType=", companyMDL.CompanyType, ";CompanyName=", companyMDL.CompanyName, ";删除公司及其关联表信息")); } else { flag = SystemSet._RETURN_FAILURE_VALUE + ":建设单位不能被删除!"; } } } catch (Exception ex) { flag = SystemSet._RETURN_FAILURE_VALUE + ex.Message; Common.LogUtil.Debug(this, "删除公司", ex); } return(flag); }
public void SetCompanyType(int UnderMyParentID, int CompanyId, bool isshowjs = false) { CompanyType.DataBindEx(UnderMyParentID, isshowjs); T_Company_MDL mdl = new T_Company_MDL(); if (CompanyId > 0) { BLL.T_Company_BLL bll = new T_Company_BLL(); mdl = bll.GetModel(CompanyId); CompanyType.SystemInfoID = mdl.CompanyType.ToString(); } }
public T_Company_MDL GetModule(int tCompanyID) { T_Company_MDL mdl = new T_Company_MDL(); if (tCompanyID > 0) { BLL.T_Company_BLL bll = new T_Company_BLL(); mdl = bll.GetModel(tCompanyID); } object obj = Comm.GetValueToObject(mdl, tbl_company); return((T_Company_MDL)obj); }
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, ""); }
/// <summary> /// 绑定页面 /// </summary> /// <param name="ID"></param> private void BindPage(string ID) { T_Role_MDL model = new T_Role_MDL(); model = roleBLL.GetModel(Convert.ToInt32(ID)); if (model != null) { ViewState["model"] = model; object obj = Comm.SetValueToPage(model, this.tbl); BLL.T_Company_BLL compBLL = new T_Company_BLL(); T_Company_MDL compMDL = compBLL.GetModel(model.CompanyID); if (compBLL != null) { CTRL_AREA.SelectValue = compMDL.AREA_CODE; } CompanyID.SelectValue = model.CompanyID.ToString(); } }
public void DataBindEx(int tCompanyID) { AREA_CODE.BindDdlArea(true); if (Common.Session.GetSession("IsCompany") == "true") { CompanyType.DataBindEx(false, "'ARCHIVE'"); } else { CompanyType.DataBindEx(false, ""); } if (tCompanyID > 0) { T_Company_MDL projectmdl = (new T_Company_BLL()).GetModel(tCompanyID); Comm.SetValueToPage(projectmdl, tbl_company); CompanyCode.Text = projectmdl.CompanyCode.Trim(); _arecode = projectmdl.AREA_CODE; } }
public string HookUpCompanyAndUser(int SingleProjectID, int UserID, int RoleID, int CompanyID, string ProjectType, string UserName, string CompanyType) { string flag = SystemSet._RETURN_SUCCESS_VALUE; try { string iSignaturePdf = "0"; //文件是否需要签章 string iSignatureWorkFlow = "0"; //是否按签章流程签章 if (ConvertEx.ToBool(SystemSet._ISIGNATUREPDF)) { iSignaturePdf = "1"; iSignatureWorkFlow = "1"; } PublicModel.AddSingleProjectUser(SingleProjectID, RoleID, UserID); //加入到工程用户表中去 PublicModel.AddSingleProjectCompany(SingleProjectID, CompanyID); //加入到工程公司表中去 userOper.CopyFileList(CompanyID, UserID, UserName, SingleProjectID, ProjectType, CompanyType, iSignaturePdf, iSignatureWorkFlow); //用户添加归档目录 #region 关联更新工程表的 施工,监理单位信息 T_SingleProject_MDL singleMDL = singleBLL.GetModel(SingleProjectID); T_Company_MDL companyMDL = companyBLL.GetModel(CompanyID); if (singleMDL != null && companyMDL != null) { if (ConvertEx.ToInt(CompanyType) == SystemSet._SGCOMPANYINFO) { singleMDL.sgdw = companyMDL.CompanyName; } else if (ConvertEx.ToInt(CompanyType) == SystemSet._JLCOMPANYINFO) { singleMDL.jldw = companyMDL.CompanyName; } singleBLL.Update(singleMDL); } #endregion } catch (Exception ex) { flag = SystemSet._RETURN_FAILURE_VALUE + ex.Message; Common.LogUtil.Debug(this, "工程相关表关联(工程用户表,工程公司表)", ex); } return(flag); }
/// <summary> /// 绑定归档目录 /// </summary> /// <param name="pageIndex"></param> private void BindGridView(int pageIndex) { T_SingleProject_MDL spMDL = spBLL.GetModel(Common.ConvertEx.ToInt(singleProjectID)); if (spMDL != null) { projectType = spMDL.ProjectType; string strWhere = " SingleProjectID=" + singleProjectID; strWhere += " AND BH not like '%S%' "; //不显示声像节点 if (PublicModel.isSuperAdmin() || !PublicModel.isCompany()) //Leo 超级管理员看全部 { } else if (spMDL != null && spMDL.CompanyUserID == Common.ConvertEx.ToInt(Common.Session.GetSession("UserID"))) //Leo 工程管理员也看全部,档案馆的人也可以看全部 { } else { strWhere += " AND operateuserid=" + Common.Session.GetSession("UserID"); } if (!String.IsNullOrWhiteSpace(txtMyCode.Text.Trim())) { strWhere += " AND MyCode LIKE '%" + txtMyCode.Text.Trim() + "%'"; } if (!String.IsNullOrWhiteSpace(txtTitle.Text.Trim())) { strWhere += " AND TITLE LIKE '%" + txtTitle.Text.Trim() + "%'"; } if (!String.IsNullOrWhiteSpace(rdbFileStatus.SelectValue) && rdbFileStatus.SelectValue != "0") { strWhere += " AND Status=" + rdbFileStatus.SelectValue; } if (!String.IsNullOrWhiteSpace(ddlCompany.SelectValue) && ddlCompany.SelectValue != "0") { T_Company_BLL compBLL = new T_Company_BLL(); T_Company_MDL compMDL = compBLL.GetModel(ConvertEx.ToInt(ddlCompany.SelectValue)); if (compMDL != null) { strWhere += " AND DefaultCompanyType=" + compMDL.CompanyType + ""; } } if (!String.IsNullOrWhiteSpace(ddlFileType.SelectValue) && ddlFileType.SelectValue != "0") { strWhere += " AND BH like '" + ddlFileType.SelectValue + "%' "; } if (!String.IsNullOrWhiteSpace(ddlChangeFile.SelectedValue)) { var changeFile = ddlChangeFile.SelectedValue; if (changeFile == "1") //有变更 { strWhere += " AND ISNULL(version,0)=(SELECT TOP 1 ISNULL(f.RollBackCount,0)from T_WorkFlowDefine f where f.SingleProjectID=" + singleProjectID + " "; strWhere += "AND f.WorkFlowID=" + PublicModel.getWorkFlowIdByWorkFlowCode(SystemSet.EumWorkFlowCode.FILEREG.ToString()) + ") "; } if (changeFile == "0") //无变更 { strWhere += " AND ISNULL(version,0) !=(SELECT TOP 1 ISNULL(f.RollBackCount,0)from T_WorkFlowDefine f where f.SingleProjectID=" + singleProjectID + " "; strWhere += "AND f.WorkFlowID=" + PublicModel.getWorkFlowIdByWorkFlowCode(SystemSet.EumWorkFlowCode.FILEREG.ToString()) + ") "; } } if (ViewState["CurrentPageIndex"] == null && Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")) > 0) { pageIndex = Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")); ViewState["CurrentPageIndex"] = pageIndex; } else { pageIndex = ConvertEx.ToInt(ViewState["CurrentPageIndex"]); } DataTable dt = fileListBLL.GetListPaging(strWhere, pageSize, pageIndex, out itemCount); AspNetPager.AlwaysShow = true; AspNetPager.PageSize = pageSize; AspNetPager.RecordCount = itemCount; AspNetPager.CurrentPageIndex = pageIndex; rpData.DataSource = dt; rpData.DataBind(); } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { T_Company_MDL model = new T_Company_MDL(); if ((CommonEnum.PageState)ViewState["ps"] == CommonEnum.PageState.ADD) { model = ctrlCompanyBaseInfo1.GetModule(0); if (model != null) { if (ConvertEx.ToInt(ctrlCompanyBaseInfo1.CompanyTypeID) == SystemSet._ARCHIVE) { model.IsCompany = false; //这是档案馆,不是建设等单位 } else { model.IsCompany = true; } model.CreateDate = System.DateTime.Now; model.CreateIP = DNTRequest.GetIP(); model.CreateUserID = Common.Session.GetSessionInt("UserID"); //公司创建人 int CompanyID = companyBLL.Add(model); //单位ID T_UsersInfo_MDL uiMdl = new T_UsersInfo_MDL(); uiMdl.UserName = txtLogName.Text.Trim(); uiMdl.LoginName = txtLogName.Text.Trim(); uiMdl.Passwd = DESEncrypt.Encrypt(txtPwd.Text); uiMdl.UserType = SystemSet.EumUserType.SignatureUser.ToString(); //签章用户 uiMdl.TrainCount = 0; uiMdl.Createdate = DateTime.Now; uiMdl.Createdby = "由" + Common.Session.GetSession("UserName") + "创建"; uiMdl.IsValid = true; uiMdl.RoleID = ConvertEx.ToInt(ctrlSignatureRole.SelectValue); //签章单位角色ID uiMdl.CompanyID = CompanyID; //所属单位 userBLL.Add(uiMdl); PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_Company;key=", model.CompanyID, ";CompanyCode=", model.CompanyCode, ";CompanyType=", model.CompanyType, ";CompanyName=", model.CompanyName, ";签章单位")); PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_UsersInfo;key=", uiMdl.UserID, ";CompanyID=", uiMdl.CompanyID, ";UserName="******";LoginName=", uiMdl.LoginName, ";UserType=", uiMdl.UserType)); } } if ((CommonEnum.PageState)ViewState["ps"] == CommonEnum.PageState.EDIT) { model = ctrlCompanyBaseInfo1.GetModule(ConvertEx.ToInt(ID)); if (ViewState["UserID"] != null) { T_UsersInfo_MDL User = userBLL.GetModel(ConvertEx.ToInt(ViewState["UserID"])); if (User != null) { User.RoleID = ConvertEx.ToInt(ctrlSignatureRole.SelectValue); //签章单位角色ID User.LoginName = txtLogName.Text.Trim(); User.Passwd = DESEncrypt.Encrypt(txtPwd.Text.Trim()); userBLL.Update(User); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_UsersInfo;key=", User.UserID, ";CompanyID=", User.CompanyID, ";UserName="******";LoginName=", User.LoginName, ";UserType=", User.UserType)); } } if (model != null) { companyBLL.Update(model); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_Company;key=", model.CompanyID, ";CompanyCode=", model.CompanyCode, ";CompanyType=", model.CompanyType, ";CompanyName=", model.CompanyName, ";签章单位")); } } Common.MessageBox.CloseLayerOpenWeb(this.Page); }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { try { #region 建设单位信息 T_Company_MDL companyMDL = new T_Company_MDL(); companyMDL = Comm.GetValueToObject(companyMDL, table_Company) as T_Company_MDL; companyMDL.CreateDate = DateTime.Now; companyMDL.IsCompany = true; companyMDL.CreateIP = Common.DNTRequest.GetIP(); companyMDL.CreateUserID = 0;//公司创建人 int companyID = companyBLL.Add(companyMDL); #endregion if (companyID > 0) { #region 项目信息 T_Construction_Project_MDL cpModel = new T_Construction_Project_MDL(); T_Construction_Project_BLL cpBll = new T_Construction_Project_BLL(); cpModel.CompanyID = companyID; //所属单位 cpModel.xmmc = xmmc.Text; //项目名称 cpModel.xmh = string.Empty; //项目号 if (jgsj.Text.Length > 0) { cpModel.jgrq = Common.ConvertEx.ToDate(jgsj.Text); //开工时间 } cpModel.jgsj = jgsj.Text; cpModel.ProjectType = ProjectType.SelectValue; int constructionProjectID = cpBll.Add(cpModel); #endregion #region 工程信息 T_SingleProject_MDL singleProjectMDL = new T_SingleProject_MDL(); singleProjectMDL = Comm.GetValueToObject(singleProjectMDL, tablemain) as T_SingleProject_MDL; singleProjectMDL.AREA_CODE = AREA_CODE.SelectValue; singleProjectMDL.ConstructionProjectID = constructionProjectID; singleProjectMDL.CreateDate = DateTime.Now; singleProjectMDL.Status = 0; //初始为0,未分配 singleProjectMDL.jsdw = companyMDL.CompanyName; //建设单位,是当前单位 singleProjectMDL.gcdd = gcdd.Text.Trim(); singleProjectMDL.WorkFlow_DoStatus = 0; int singleProjectID = singleProjectBLL.Add(singleProjectMDL); //工程ID UploadFile(singleProjectID); //上传证书 #endregion #region 用户信息 ,角色默认给先前定义好的建设单位角色 T_UsersInfo_MDL userMDL = new T_UsersInfo_MDL(); userMDL = (T_UsersInfo_MDL)Comm.GetValueToObject(userMDL, tLoginInfo); userMDL.RoleID = roleBLL.GetRoleIdByRoleCode(SystemSet._ROLECODE_JSCOMPANY, singleProjectMDL.AREA_CODE); userMDL.Passwd = DESEncrypt.Encrypt(Passwd.Text); userMDL.UserType = SystemSet.EumUserType.CompanyUser.ToString(); userMDL.UserName = userMDL.LoginName; userMDL.CompanyID = companyID; userMDL.Createdate = DateTime.Now; userMDL.LastLoginTime = DateTime.Now; userMDL.IsLeader = true; userMDL.IsValid = false; userMDL.Createdby = "工程报建产生"; int userID = userBLL.Add(userMDL); #endregion #region 添加工程用户关联信息 PublicModel.AddSingleProjectUser(singleProjectID, userMDL.RoleID, userID); #endregion #region 添加工程公司关联信息 PublicModel.AddSingleProjectCompany(singleProjectID, companyID); #endregion #region 添加工程流程环节 new T_WorkFlowDefine_BLL().AddWorkFlowDefine(singleProjectID, singleProjectMDL.AREA_CODE); #endregion #region 更新工程表的 CompanyUserID为当前建设单位用户ID singleProjectMDL = singleProjectBLL.GetModel(singleProjectID); singleProjectMDL.CompanyUserID = userID; singleProjectBLL.Update(singleProjectMDL); #endregion #region 报建完成提示信息 this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "IsSuccess", "<script>" + " layer.alert('您已经成功注册,但您注册的信息,必需确认后才可以登录使用。请耐心等待,或致电:" + SystemSet._QUICKREGTEL + "', { btnAlign: 'c' }, function (i) {" + " var index = parent.layer.getFrameIndex(window.name);" + " parent.layer.close(index);" + "}); " + "</script>"); #endregion } } catch (Exception ex) { Common.LogUtil.Debug(this, "建设单位工程报建", ex); Common.MessageBox.FnLayerAlert(this.Page, "工程报建保存失败:" + ex.Message); } }
/// <summary> /// 用户登录 /// </summary> /// <param name="context"></param> /// <returns></returns> public string getUserInfo(HttpContext context) { try { if (context.Request.Form["username"] == null || context.Request.Form["password"] == null) { return("账号或密码为空!"); } T_UsersInfo_BLL userinfobll = new T_UsersInfo_BLL(); string strPrivateKey = string.Empty; using (StreamReader reader = new StreamReader(context.Server.MapPath("/RsaKey/PrivateKey.xml"))) { strPrivateKey = reader.ReadToEnd(); } RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); rsa.FromXmlString(strPrivateKey); byte[] result = rsa.Decrypt(UserLoginGather.HexStringToBytes(context.Request.Form["password"]), false); System.Text.ASCIIEncoding enc = new ASCIIEncoding(); string rsaPwd = enc.GetString(result); string loginString = "UPPER(loginname)='" + Common.Common.SqlSafe(context.Request.Form["username"]).ToUpper() + "' and passwd='" + DESEncrypt.Encrypt(rsaPwd) + "' "; List <T_UsersInfo_MDL> userinfomdl = userinfobll.GetModelList(loginString); if (userinfomdl.Count > 0) { if (userinfomdl[0].IsValid == true) { T_Company_BLL compBLL = new T_Company_BLL(); T_Company_MDL compMDL = compBLL.GetModel(userinfomdl[0].CompanyID); if (compMDL != null) { context.Session["IsCompany"] = compMDL.IsCompany.ToString().ToLower(); context.Session["CompanyName"] = compMDL.CompanyName; context.Session["OLD_AREA_CODE"] = compMDL.AREA_CODE; context.Session["AREA_CODE"] = ""; if (compMDL.IsCompany.ToString().ToLower() == "false") //只有档案馆,需要区域信息,建设单位等都不要过虑 { string myArea_Code = compMDL.AREA_CODE; string myArea_CodeNew = compMDL.AREA_CODE; for (int i1 = myArea_Code.Length - 1; i1 > 0; i1--) { if (myArea_Code[i1].ToString() == "0") { myArea_CodeNew = myArea_Code.Substring(0, i1); } else { break; } } context.Session["AREA_CODE"] = myArea_CodeNew; } context.Session["CompanyType"] = compMDL.CompanyType; } else { return(SystemSet._RETURN_FAILURE_VALUE + ":单位信息不存在!"); } BLL.T_SystemInfo_BLL systemInfoBLL = new T_SystemInfo_BLL(); Model.T_SystemInfo_MDL systemInfoMDL = systemInfoBLL.GetModel(compMDL.CompanyType); if (systemInfoMDL == null) { return(SystemSet._RETURN_FAILURE_VALUE + ":单位类型字典不存在!"); } context.Session["CompanyTypeName"] = systemInfoMDL.SystemInfoName; context.Session["CompanyTypeCode"] = systemInfoMDL.SystemInfoCode; context.Session["SystemInfoID"] = systemInfoMDL.SystemInfoID; context.Session["MyParentID"] = systemInfoMDL.ParentID; context.Session["UserID"] = userinfomdl[0].UserID; context.Session["LoginName"] = userinfomdl[0].LoginName; context.Session["UserName"] = userinfomdl[0].UserName; context.Session["RoleID"] = userinfomdl[0].RoleID; context.Session["CompanyID"] = userinfomdl[0].CompanyID; context.Session["IsLeader"] = userinfomdl[0].IsLeader; context.Session["SuperAdmin"] = userinfomdl[0].IsSuperAdmin; context.Session["OwnerFileTmp"] = userinfomdl[0].OwnerFileTmp; //外协单位用户 T_Role_MDL roleMDL = new T_Role_BLL().GetModel(userinfomdl[0].RoleID); //签章用 if (roleMDL != null) { context.Session["RoleName"] = roleMDL.RoleName; context.Session["RoleCode"] = roleMDL.RoleCode; } TimeSpan ts = new TimeSpan(8760, 0, 0); DateTime expired = DateTime.Today.Add(ts); HttpContext.Current.Response.Cookies["LoginName"].Value = context.Server.UrlEncode(userinfomdl[0].LoginName); HttpContext.Current.Response.Cookies["LoginName"].Expires = expired; //修改最后登录时间 userinfomdl[0].LastLoginTime = DateTime.Now; userinfobll.Update(userinfomdl[0]); PublicModel.writeLog(SystemSet.EumLogType.LogIn.ToString(), ";用户登录系统"); return(SystemSet._RETURN_SUCCESS_VALUE); } else { return("如果您已经成功注册,请等待确认后再登录!"); } } else { return("用户账号或密码错误!"); } } catch (Exception ex) { Common.LogUtil.Debug(this, "用户登录BUG", ex); return("系统异常,请稍后再试"); } }
//绑定归档目录 private void BindGridView(int pageIndex) { T_SingleProject_MDL spMDL = spBLL.GetModel(Common.ConvertEx.ToInt(singleProjectID)); if (spMDL != null) { singleProjectNo = spMDL.gcbm; projecttype = spMDL.ProjectType; //取当前工程的所有归档目录 string strWhere = " SingleProjectID=" + singleProjectID; //不显示声像节点 //jdk 2014.11.16 strWhere += " AND BH not like '%S%' "; if (PublicModel.isCompany() && !PublicModel.isLeader()) //监理或施工只能看到自己的 { strWhere += " and operateuserid=" + Common.Session.GetSession("UserID"); } if (ConvertEx.ToBool(SystemSet._ISIGNATUREPDF)) { if (!string.IsNullOrWhiteSpace(ddliSignaturePdf.SelectedValue)) { strWhere += " AND iSignaturePdf=" + ddliSignaturePdf.SelectedValue + ""; //是否需要签章 } if (!string.IsNullOrWhiteSpace(ddlSignatureFinishFlag.SelectedValue)) //签章完成状态 { string tempStrWhere = " and iSignaturePdf=1 and IsFolder=0 and (SELECT COUNT(1) from T_FileList_SignatureTmp f1 where f1.FileListID=T_FileList.OldRecID)>0 "; int signatureFinishFlag = ConvertEx.ToInt(ddlSignatureFinishFlag.SelectedValue); //签章是否完成标记 那已签章完成的记录跟需要签章的记录比对. if (signatureFinishFlag == 1) //签章完成 { tempStrWhere += "and (SELECT COUNT(1) from T_FileList_SignatureLog f0 where f0.FileListID=T_FileList.FileListID and f0.SignatureFinishFlag=1)"; tempStrWhere += ">=(SELECT COUNT(1) from T_FileList_SignatureTmp f1 where f1.FileListID=T_FileList.OldRecID) "; strWhere += tempStrWhere; } else if (signatureFinishFlag == 0) //签章未完成 { tempStrWhere += "and (SELECT COUNT(1) from T_FileList_SignatureLog f0 where f0.FileListID=T_FileList.FileListID and f0.SignatureFinishFlag=1)"; tempStrWhere += "<(SELECT COUNT(1) from T_FileList_SignatureTmp f1 where f1.FileListID=T_FileList.OldRecID) "; strWhere += tempStrWhere; } } } if (!String.IsNullOrWhiteSpace(txtMyCode.Text.Trim())) { strWhere += " AND MyCode LIKE '%" + txtMyCode.Text.Trim() + "%'"; } if (!String.IsNullOrWhiteSpace(txtTitle.Text.Trim())) { strWhere += " AND TITLE LIKE '%" + txtTitle.Text.Trim() + "%'"; } if (!String.IsNullOrWhiteSpace(rdbFileStatus.SelectValue) && rdbFileStatus.SelectValue != "0") { strWhere += " AND Status=" + rdbFileStatus.SelectValue; } if (!String.IsNullOrWhiteSpace(ddlCompany.SelectValue) && ddlCompany.SelectValue != "0") { T_Company_BLL compBLL = new T_Company_BLL(); T_Company_MDL compMDL = compBLL.GetModel(ConvertEx.ToInt(ddlCompany.SelectValue)); if (compMDL != null) { strWhere += " AND DefaultCompanyType=" + compMDL.CompanyType + ""; } } if (!String.IsNullOrWhiteSpace(ddlFileType.SelectValue) && ddlFileType.SelectValue != "0") { strWhere += " AND BH like '" + ddlFileType.SelectValue + "%' "; } Session["FileInfostrWhere"] = strWhere; if (ViewState["CurrentPageIndex"] == null && Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")) > 0) { pageIndex = Common.ConvertEx.ToInt(DNTRequest.GetQueryString("PageIndex")); ViewState["CurrentPageIndex"] = pageIndex; } else { pageIndex = ConvertEx.ToInt(ViewState["CurrentPageIndex"]); } DataTable dt = fileListBLL.GetListPaging(strWhere, pageSize, pageIndex, out itemCount);; AspNetPager.AlwaysShow = true; AspNetPager.PageSize = pageSize; AspNetPager.RecordCount = itemCount; AspNetPager.CurrentPageIndex = pageIndex; rpData.DataSource = dt; rpData.DataBind(); } }