/// <summary> /// 根据文件夹的ID,获取到该文件夹的基本属性 /// </summary> /// <param name="FID"></param> private void showInfo(string FID) { try { FID = commons.RequestSafeString(FID, 50); mdf = bdf.GetModel(int.Parse(FID)); Label_cname.Text = mdf.FolderName.ToString(); RadioButtonList_isshare.SelectedValue = mdf.IsShare.ToString(); showbuttom(mdf.UserID.ToString()); //先根据当前的共享情况,获取之前的共享人员列表 if (mdf.IsShare.ToString() == "1") { DataTable dt = new DataTable(); dt = bdfs.GetList(" FolderID='" + FID + "'").Tables[0]; shareForUser1.showDepartment(dt); shareForUser1.Visible = true; } else { shareForUser1.Visible = false; } } catch { } }
/// <summary> /// 显示数据 /// </summary> /// <param name="objectID"></param> private void showinfo(string objectID) { try { objectID = commons.RequestSafeString(objectID, 50); if (!String.IsNullOrEmpty(objectID)) { modeCA = bllCA.GetModel(int.Parse(objectID)); if (modeCA != null) { txtCardName.Text = modeCA.NAMES; RadioButtonList_status.SelectedValue = modeCA.STATUS.ToString(); txtLimitNums.Text = modeCA.Balance.ToString(); string FreezeTime = modeCA.FreezeTime.ToString(); if (!string.IsNullOrEmpty(FreezeTime)) { TB_DateTime.Value = DateTime.Parse(FreezeTime).ToString("yyyy-MM-dd"); } txtEveryDayNum.Text = modeCA.EveryDayNum.ToString(); ViewState["_theModifyCA"] = modeCA;//将要处理的数据集保存一下 } } } catch { } }
/// <summary> /// 显示数据 /// </summary> /// <param name="objectID"></param> private void showinfo(string objectID) { try { objectID = commons.RequestSafeString(objectID, 50); if (!String.IsNullOrEmpty(objectID)) { modelCF = bllCF.GetModel(int.Parse(objectID)); if (modelCF != null) { DropDownList_Account.SelectedValue = modelCF.AccountID.ToString(); DropDownList_year.SelectedValue = modelCF.YEARS.ToString(); TextBox_TotalNum.Text = modelCF.TotalNum.ToString(); RadioButtonList_IsListApply.SelectedValue = modelCF.IsListApply.ToString(); txtCardName.Text = modelCF.NAMES; RadioButtonList_status.SelectedValue = modelCF.STATUS.ToString(); txtLimitNums.Text = modelCF.Balance.ToString(); ViewState["_theModifyCF"] = modelCF;//将要处理的数据集保存一下 } } } catch { } }
/// <summary> /// 根据文件夹的ID,获取到该文件夹的基本属性 /// </summary> /// <param name="FID"></param> private void showInfo(string FID, string tp, string projectid) { try { FID = commons.RequestSafeString(FID, 50); mdf = bdf.GetModel(int.Parse(FID)); TextBox_FolderName.Text = mdf.FolderName.ToString(); // RadioButtonList_isshare.SelectedValue = mdf.IsShare.ToString(); showuserColumns(mdf.UserID.ToString(), tp, projectid);//加载栏目的结构 showbuttom(mdf.UserID.ToString()); DropDownList_upid.SelectedValue = mdf.UpID.ToString(); } catch { } }
/// <summary> /// 获取返回时的地址 /// </summary> /// <returns></returns> public string urls() { string coutw = ""; try { string fileid = Request["fileid"]; string foldeid = Request["foldeid"]; string[] arrays = fileid.Split(';'); string[] arrays2 = foldeid.Split(';'); //通过文件的ID获取到文件夹的ID if (arrays.Length > 0 && arrays[0].Length > 0) { mdfile = bdfile.GetModel(int.Parse(arrays[0].ToString())); string tp = Request["tp"]; //url传值过来的页卡参数 string FID = mdfile.FolderID.ToString(); // HiddenField_pid.Value.ToString();//url传值过来的参数 FID = commons.RequestSafeString(FID, 50); coutw = "manage.aspx?CID=" + bdFExt.getFolderPathById(FID) + "&tp=" + tp; } else { if (arrays2.Length > 0 && arrays2[0].Length > 0) { mdf = bdf.GetModel(int.Parse(arrays2[0].ToString())); string tp = Request["tp"]; //url传值过来的页卡参数 string FID = mdf.UpID.ToString(); // HiddenField_pid.Value.ToString();//url传值过来的参数 FID = commons.RequestSafeString(FID, 50); coutw = "manage.aspx?CID=" + bdFExt.getFolderPathById(FID) + "&tp=" + tp; } else { string tp = Request["tp"];//url传值过来的页卡参数 string CID = ""; if (tp == "2") { CID = "&CID=" + Request["CID"]; } coutw = "manage.aspx?tp=" + tp + CID; //string coutws = "<script language=\"javascript\" type=\"text/javascript\">location.href = \"manage.aspx?tp=" + tp + CID + "\";</script>"; } } } catch { } return(coutw); }
/// <summary> /// 根据项目的ID获取到当前项目下的一些功能按钮是否可以使用 /// false表示不可用,true表示可以用 /// </summary> /// <param name="projectid"></param> /// <returns></returns> public bool ProjectStatus(string projectid) { bool coutw = false; try { projectid = commonss.RequestSafeString(projectid, 50); mProjcet = bProject.GetModel(int.Parse(projectid)); if (mProjcet.Status == 1 && mProjcet.DELFLAG == 0) { coutw = true; } } catch { coutw = false; } return(coutw); }
/// <summary> /// 根据文件夹的ID,获取到该文件夹的基本属性 /// </summary> /// <param name="FID">文件的ID</param> private void showInfo(string FID, string tp, string projectid) { try { FID = commons.RequestSafeString(FID, 50); //根据文件ID获取到 mdfile = bdfile.GetModel(int.Parse(FID)); TextBox_FolderName.Text = mdfile.FileName.ToString(); showuserColumns(mdfile.UserID.ToString(), tp, projectid);//加载栏目的结构 DropDownList_upid.SelectedValue = mdfile.FolderID.ToString(); showbuttom(mdfile.UserID.ToString()); HiddenField_oldpath.Value = mdfile.FilePath.ToString();//老的文件的地址 HiddenField_pid.Value = mdfile.FolderID.ToString(); } catch { } }
/// <summary> /// 获取返回时的地址 /// </summary> /// <returns></returns> public string urls() { string coutw = ""; try { //通过文件的ID获取到文件夹的ID string tp = Request["tp"]; //url传值过来的页卡参数 string FID = DropDownList_upid.SelectedValue.ToString(); FID = commons.RequestSafeString(FID, 50); coutw = "manage.aspx?CID=" + bdFExt.getFolderPathById(FID) + "&tp=" + tp; } catch { } return(coutw); }
/// <summary> /// 查看专项资金下面的预算报告列表 /// </summary> /// <param name="spacialFundsid"></param> private void list(string spacialFundsid) { spacialFundsid = commons.RequestSafeString(spacialFundsid, 50); string sql = "select * from vCash_SF_Order where SpecialFundsID=" + spacialFundsid + " order by ADDTIME desc"; DataTable dt = new DataTable(); dt = compage.doSql(sql).Tables[0]; //=======添加汇总信息 by guanzhq on 2012年3月20日 begin======= if (dt != null) { //重新绑定数据 GridView1.DataSource = dt; GridView1.DataBind(); if (dt.Rows.Count > 0) { string TotalNum = dt.Rows[0]["SFTotalNum"].ToString(); //预算金额 string Balance = dt.Rows[0]["SFBalance"].ToString(); //可用金额 //获取项目总金额 double rel = 0; foreach (DataRow dr in dt.Rows) { if (dr["BAUNIT"].ToString().Trim() == "万元") { int temp = 0; int.TryParse(dr["ActualAmount"].ToString(), out temp); temp = temp * 10000; rel += temp; } else { int temp = 0; int.TryParse(dr["ActualAmount"].ToString(), out temp); rel += temp; } } //添加汇总信息 //lblhuizong.Text = "<table class='GridView1'><tr><td>专项资金预算金额:</td><td>" + string.Format("{0:n}", TotalNum) + "元</td><td>项目总金额:</td><td>" + string.Format("{0:n}", rel) + "元</td><td>可用金额:</td><td>" + string.Format("{0:n}", Balance) + "元</td></tr></table> "; lblhuizong.Text = "<table width='100%' height='50px' style='border: solid 1px #99cccd; text-align: center' cellpadding='0' cellspacing='0'><tr style='background-color: #99cccd;'><td>可用金额</td><td>项目总金额</td><td>预算金额</td></tr><tr><td style='border-right: solid 1px #99cccd; width: 120px'>" + string.Format("{0:n}", double.Parse(Balance)) + "元</td><td style='border-right: solid 1px #99cccd'>" + string.Format("{0:n}", rel) + "元</td><td style='border-right: solid 1px #99cccd'>" + string.Format("{0:n}", double.Parse(TotalNum)) + "元</td></tr></table>"; notice.Text = ""; } else { notice.Text = "该专项资金暂无预算!"; lblhuizong.Text = ""; } } else { notice.Text = "该专项资金暂无预算!"; lblhuizong.Text = ""; } //=======添加汇总信息 by guanzhq on 2012年3月20日 end======= //if (dt != null) //{ // GridView1.DataSource = dt; // GridView1.DataBind(); // notice.Text = " "; //} //if (GridView1.Rows.Count == 0) //{ // notice.Text = "该专项资金暂无预算!"; //} }
/// <summary> /// 根据文件的属性是项目的还是个人的,还有用户的ID,项目的ID获取到列表 /// </summary> /// <param name="userid">用户的ID</param> /// <param name="types">文件的归类:public是项目的文件夹;private是个人的文件夹</param> /// <param name="projectid">项目的ID(select in ('0','ds')的方式)</param> public DataTable makeFolder1(string userid, string types, string projectid, string TJ) { DataTable DTColumns = new DataTable(); if (TJ == "and ( status is null or Status=-1)") { TJ = ""; } else if (String.IsNullOrEmpty(TJ)) { TJ = "and ( status is null or Status=1)"; } try { userid = commons.RequestSafeString(userid, 50); types = commons.RequestSafeString(types, 50); projectid = commons.RequestSafeString(projectid, 50); // 用来比对子栏目是否为顶级节点 string sqlwhere = ""; if (types == "private") { sqlwhere = " Types='" + types + "' and UserID='" + userid + "' and DELFLAG='0'" + TJ + " order by COLUMNSPATH"; DTColumns = bdf.GetList(sqlwhere).Tables[0]; } else if (types == "public") { if (projectid.Length > 0)//表示仅仅取该项目的文档 { sqlwhere = "select * from vDocument_Folder where Types='" + types + "' and (projectid='" + projectid + "' or upid='-1') and DELFLAG='0' " + TJ + " order by COLUMNSPATH"; DTColumns = pageconto.doSql(sqlwhere).Tables[0]; //DTColumns = bdf.GetList(sqlwhere).Tables[0]; } else { // sqlwhere = " Types='" + types + "' and (projectid in(select id from Project_Projects where leaderid='" + userid + "') or projectid in(select Projectid from Project_UserList where userid='" + userid + "' and status='1') or projectid='0') and DELFLAG='0' order by COLUMNSPATH"; sqlwhere = "select * from vDocument_Folder where Types='" + types + "' and (projectid in(select id from Project_Projects where leaderid='" + userid + "') or projectid in(select Projectid from Project_UserList where userid='" + userid + "' and status='1') or projectid='0') and DELFLAG='0' AND (PDEL=0 OR PDEL IS NULL) " + TJ + " order by status,COLUMNSPATH"; DTColumns = pageconto.doSql(sqlwhere).Tables[0]; System.Web.HttpContext.Current.Session["tj"] = ""; } // DTColumns = bdf.GetList(sqlwhere).Tables[0]; } else//共享文档 { //根据当前的用户,从视图中找出所有的提供共享的组织内用户 string sql1 = " SELECT userid,username,realname,shareForuser,shareForuser+'/'+userid as paths FROM vDocument_File_Share where shareforuser='******' and delflag='0' group by userid,username,realname,shareForuser"; string sql2 = "select userid,username,realname,shareForuser,shareForuser+'/'+userid as paths from vDocument_Folder_Share where shareforuser='******' and delflag='0' group by userid,username,realname,shareForuser"; DataTable dt1 = pageconto.doSql(sql1).Tables[0]; DataTable dt2 = pageconto.doSql(sql2).Tables[0]; DTColumns = commons.CombineTheSameDatatable(dt1, dt2); DTColumns = commons.makeDistinceTable(DTColumns, "userid"); System.Web.HttpContext.Current.Session["tj"] = ""; } // 有子栏目,则显示树 } catch { System.Web.HttpContext.Current.Session["tj"] = ""; } return(DTColumns); }