public string getmoney(string strdeptCode, string strkmCode, string strgcCode) { string strsql = "select isnull(sum(ysje),0) from bill_ysmxb where ysdept='" + strdeptCode + "' and yskm='" + strkmCode + "' and gcbh='" + strgcCode + "' and (ysType='1' or ysType='5')"; string strRet = server.GetCellValue(strsql); return(strRet); }
protected void Page_Load(object sender, EventArgs e) { if (Session["userCode"] == null || Session["userCode"].ToString().Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "window.location.href='../inde.aspx','_self';", true); return; } if (string.IsNullOrEmpty(Request["type"])) { ClientScript.RegisterStartupScript(this.GetType(), "", "window.location.href='../Index.aspx','_self';", true); return; } if (!IsPostBack) { BindDDL(); if (Request["type"] == "add") { CreateLscgCode(); txt_sj.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); txt_cbr.Text = server.GetCellValue("select '['+usercode+']'+userName from bill_users where usercode='" + Session["userCode"].ToString() + "'"); txt_dept.Text = server.GetCellValue("select '['+deptcode+']'+deptName from bill_departments where deptcode=(select userdept from bill_users where usercode='" + Session["userCode"].ToString() + "')"); } else if (Request["type"] == "edit" && !string.IsNullOrEmpty(Request["billCode"])) { BindData(); } } }
//protected string strdate = ""; protected void Page_Load(object sender, EventArgs e) { if (Session["userCode"] == null || Session["userCode"].ToString().Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "window.location.href='../Login.aspx','_self';", true); return; } if (!IsPostBack) { //strdate = DateTime.Now.ToString("yyyy-MM-dd"); SysManager sysMgr = new SysManager(); txtBillCode.Text = sysMgr.GetYbbxBillName("", DateTime.Now.ToString("yyyMMdd"), 1); string strType = Request.QueryString["type"]; if (Page.Request.QueryString["djtype"] == null) { this.hd_djtype.Value = "ybbx"; hfdydj.Value = "02"; this.lbdjmc.Text = "费用报销单→表头信息"; } else { this.hd_djtype.Value = Page.Request.QueryString["djtype"].ToString().Trim(); this.lbdjmc.Text = "其他报销单"; hfdydj.Value = "02"; } IList <Bill_DataDic> list = (new SysManager()).GetDicByType("02"); ddlBxmxlx.DataSource = list; ddlBxmxlx.DataTextField = "DicName"; ddlBxmxlx.DataValueField = "DicCode"; ddlBxmxlx.DataBind(); //2014-04-28 beg if (!string.IsNullOrEmpty(Request["dydj"]) && Request["dydj"] == "sr") { this.hd_djtype.Value = Page.Request.QueryString["dydj"].ToString().Trim(); this.lbdjmc.Text = "收入单"; ddlBxmxlx.SelectedValue = "04"; } //2014-04-28 end //2014-04-29 beg if (!string.IsNullOrEmpty(Request["dydj"]) && Request["dydj"] == "gdzcgz") { this.hd_djtype.Value = Page.Request.QueryString["dydj"].ToString().Trim(); hfdydj.Value = "03"; this.lbdjmc.Text = "固定资产购置单"; ddlBxmxlx.SelectedValue = "05"; } //2014-04-29 end txtBillDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); txtZdr.Text = server.GetCellValue("select '['+usercode+']'+userName from bill_users where userCode='" + Session["userCode"] + "'"); txtBillDept.Text = server.GetCellValue("select '['+a.deptCode+']'+a.deptName as dept from bill_departments a,bill_users b where a.deptCode=b.userDept and b.userCode='" + Session["userCode"] + "'"); BindGk(); } }
private string GetTitleByFlowid(string flowid) { string text = server.GetCellValue("select flowName from mainworkflow where flowId='" + flowid + "'"); if (!string.IsNullOrEmpty(text) && text.IndexOf("审批") == -1) { text += "审批"; } return(text); }
protected void rptMenu_ItemDataBound(object sender, RepeaterItemEventArgs e) { HiddenField hf = e.Item.FindControl("hfId") as HiddenField; string sql = server.GetCellValue("select isnull(getCountSql,'') from ph_sysmenu where menuid='" + hf.Value + "'"); if (!string.IsNullOrEmpty(sql)) { int count = Convert.ToInt32(server.GetCellValue(sql.Replace("@userCode", "'" + Session["userCode"].ToString() + "'"))); HtmlContainerControl span = e.Item.FindControl("span_num") as HtmlContainerControl; span.InnerText = count.ToString(); } }
/// <summary> /// 获取二级单位编号 /// </summary> /// <param name="deptCode"></param> /// <returns></returns> public string GetDeptLevel2(string deptCode) { string sjDept = ""; string returnDept = deptCode; sjDept = server.GetCellValue("select sjDeptCode from bill_departments where deptCode='" + deptCode + "'"); if (server.GetCellValue("select sjDeptCode from bill_departments where deptCode='" + sjDept + "'") == "") { return(returnDept); } else { return(this.GetDeptLevel2(sjDept)); } }
private void BindModel() { string code = Convert.ToString(Request["billCode"]); DataTable dt = server.GetDataTable("select * from bill_lscg where cgbh='" + code + "'", null); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; lb_cgbh.Text = ObjectToStr(dr["cgbh"]); lb_sj.Text = Convert.ToDateTime(ObjectToStr(dr["sj"])).ToString("yyyy-MM-dd"); lb_cbr.Text = server.GetCellValue("select '['+usercode+']'+userName from bill_users where usercode='" + ObjectToStr(dr["cbr"]) + "'"); lb_yjfy.Text = Convert.ToDecimal(ObjectToStr(dr["yjfy"])).ToString("N02"); lb_dept.Text = server.GetCellValue("select '['+deptcode+']'+deptName from bill_departments where deptcode='" + ObjectToStr(dr["cgDept"]) + "'"); lb_cglb.Text = ObjectToStr(dr["cglb"]); lb_zynr.Text = ObjectToStr(dr["zynr"]); lb_sm.Text = ObjectToStr(dr["sm"]); } string type = Request["type"]; if (!string.IsNullOrEmpty(type)) { if (type == "View") { aduittr.Visible = false; btn_audit.Visible = false; btn_cancel.Visible = false; //判断是否已提交 DataTable dt1 = server.GetDataTable("select * from workflowrecord where billCode='" + code + "'", null); if (dt1.Rows.Count > 0) { btn_submit.Visible = false; btn_delete.Visible = false; if (dt1.Rows[0]["rdState"].ToString() == "3") { btn_revoke.Visible = true; } } } if (type == "audit") { btn_submit.Visible = false; btn_delete.Visible = false; aduittr.Visible = true; } } }
/// <summary> /// 根据配置项获取 呼获取链接数据库的字段 /// </summary> /// <returns></returns> public string GetDbName() { string ret = ""; string ip = server.GetCellValue("select avalue from t_Config where akey='ykspIP' "); string dbName = server.GetCellValue("select avalue from t_Config where akey='ykspDbName' "); string structure = server.GetCellValue("select avalue from t_Config where akey='ykspStructureName' "); string tbName = server.GetCellValue("select avalue from t_Config where akey='ykspTbName' "); if (!string.IsNullOrEmpty(dbName) && !string.IsNullOrEmpty(structure) && !string.IsNullOrEmpty(tbName)) { ret = dbName + "." + structure + "." + tbName; } return(ret); }
/// <summary> /// 查询是不是二级单位 /// </summary> /// <param name="strus">是人员CODE?y:n</param> /// <param name="usercode">人员CODE</param> /// <returns></returns> public bool isTopDept(string strus, string usercode) { string sql = ""; if (strus == "y") { sql = " select count(1) from (select deptCode from bill_departments where sjDeptCode=(select deptCode from bill_departments where isnull(sjDeptCode,'')='') or isnull(sjDeptCode,'')='')a where deptCode=(select userdept from bill_users where usercode='" + usercode + "')"; } else { sql = " select count(1) from (select deptCode from bill_departments where sjDeptCode=(select deptCode from bill_departments where isnull(sjDeptCode,'')='') or isnull(sjDeptCode,'')='')a where deptCode='" + usercode + "'"; } if (server.GetCellValue(sql) == "1") { return(true); } else { return(false); } }
/// <summary> /// 获取当前用户未提交的一般报销单 /// </summary> /// <returns></returns> private int GetYbbxData() { string djlx = "ybbx"; string sql = @"select billName,billuser,isGk,gkDept,(select bxzy from bill_ybbxmxb where bill_ybbxmxb.billCode=bill_main.billCode) as bxzy,stepid,billDept,billCode, (select xmmc from bill_ysgc where gcbh=billName) as billName2, (select '['+usercode+']'+username from bill_users where usercode=billuser) as billUserName, billdate,billje ,Row_Number()over(order by billName desc,billdate desc) as crow from bill_main where (billUser='******' or billCode in (select billCode from bill_ybbxmxb where bxr='" + Session["userCode"].ToString().Trim() + "')) and flowID='" + djlx + "'"; string strsqlcount = "select isnull(count(*),0) from ( {0} ) t"; strsqlcount = string.Format(strsqlcount, sql); return(int.Parse(server.GetCellValue(strsqlcount))); }
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer) { HiddenField hf = e.Item.FindControl("hfCode") as HiddenField; string code = hf.Value.Trim(); if (!string.IsNullOrEmpty(code)) { StringBuilder sb = new StringBuilder(); string status = ""; DataTable workflow = server.GetDataTable("select * from workflowrecord where billCode='" + code + "'", null); if (workflow.Rows.Count == 0) { sb.Append("<div class='checkStatus' ><lable>审批状态:未提交</lable></div>"); } else { status = workflow.Rows[0]["rdState"].ToString(); if (status == "1") { WorkFlowRecordManager bll = new WorkFlowRecordManager(); string state = bll.WFState(code); sb.Append("<div class='checkStatus' ><lable>审批状态:" + state + "</lable></div>"); } else if (status == "2") { sb.Append("<div class='checkStatus'><lable>审批状态:审核通过</lable></div>"); } else if (status == "3") { string flowid = server.GetCellValue("select flowid from bill_main where billCode='" + code + "'"); sb.Append("<div class='checkStatus'><lable>审批状态:驳回</lable></div>"); sb.Append("<div style='text-align:center'><a data-role='button' data-inline='true' data-theme='d' onclick=\"RevokeCheck(this,'" + flowid + "','" + code + "')\"><img src='../images/metro/Editor.png' />审核撤销</a></div>"); } } Label lb = e.Item.FindControl("lbmx") as Label; lb.Text = sb.ToString(); HtmlContainerControl hcc = e.Item.FindControl("optionDiv") as HtmlContainerControl; if (status == "3") { hcc.Attributes.CssStyle.Add("display", "none"); } else if (!string.IsNullOrEmpty(status)) { hcc.Visible = false; } } } }
public int intRowAdd(string strtype, string strdiccode, string strdicname) { string strsqlexit = "select count(*) from bill_datadic where dictype=@dictype and diccode=@deptcode and dicname=@dicname"; string strrel = server.GetCellValue(strsqlexit, new SqlParameter[] { new SqlParameter("@dictype", strtype), new SqlParameter("@deptcode", strdiccode), new SqlParameter("@dicname", strdicname) }); int count = string.IsNullOrEmpty(strrel) ? 0 : int.Parse(strrel); if (count > 0) { return(0); } string strsqladd = "insert into bill_datadic (dicType,dicCode,dicName,cjys,cys,cdj) values(@dictype,@diccode,@dicname,'','','')"; return(server.ExecuteNonQuery(strsqladd, new SqlParameter[] { new SqlParameter("@dictype", strtype), new SqlParameter("@diccode", strdiccode), new SqlParameter("dicname", strdicname) })); }
/// <summary> /// /// </summary> /// <param name="userCode"></param> /// <returns></returns> public string GetZgDepartments(string userCode) { DataSet temp = server.GetDataSet("select * from bill_dept_ywzg where userCode='" + userCode + "'"); string returnStr = ""; if (temp.Tables[0].Rows.Count == 0)//没有设置主管单位 则默认管理本单位及其下级 { return(this.GetDepartments(server.GetCellValue("select userDept from bill_users where userCode='" + userCode + "'"), "")); } else { for (int i = 0; i <= temp.Tables[0].Rows.Count - 1; i++) { returnStr += temp.Tables[0].Rows[i]["deptCode"].ToString().Trim() + ","; } } if (returnStr != "") { returnStr = returnStr.Substring(0, returnStr.Length - 1); } return(returnStr); }
/// <summary> /// 根据参数获取dataTable 并返回页面导航字符串 /// </summary> /// <param name="sql">获取数据的sql</param> /// <param name="parms">sql参数(方便参数化查询)</param> /// <param name="url">url</param> /// <param name="pageNav">输出参数 页码导航</param> /// <returns>请求页面的数据,并返回页面导航</returns> public static DataTable GetPageData(string sql, string url, out string pageNav) { sqlHelper.sqlHelper server = new sqlHelper.sqlHelper(); string pageStr = HttpContext.Current.Request["page"]; int pageIndex = 0; if (!string.IsNullOrEmpty(pageStr)) { pageIndex = Convert.ToInt32(pageStr); } DataTable dt; int count = 0; if (string.IsNullOrEmpty(sql)) { pageNav = ""; return(null); } string conSql = "select count(*) from (" + sql + ") as t"; string dtSql = "select * from ({0}) as t where t.crow>{1} and t.crow <={2}"; dtSql = string.Format(dtSql, sql, pageIndex * 10, (pageIndex + 1) * 10); count = Convert.ToInt32(server.GetCellValue(conSql)); dt = server.GetDataTable(dtSql, null); StringBuilder sb = new StringBuilder(); int pageCount = count % 10 == 0 ? (count / 10) : (count / 10 + 1); int prevNum = pageIndex - 1; int nextNum = pageIndex + 1; sb.Append("<p id='page'>"); if (prevNum >= 0) { if (url.IndexOf("?") == -1) { sb.Append("<a href='" + url + "?page=" + prevNum + "' class='n'><上一页</a>"); } else { sb.Append("<a href='" + url + "&page=" + prevNum + "' class='n'><上一页</a>"); } } if (pageCount > 1) { if (pageCount <= 7) { for (int i = 0; i < pageCount; i++) { sb.Append("<a href='" + url + "'> <span class='pc'>" + (i + 1) + "</span></a> "); if (i == pageIndex) { sb.Append("<strong><span class='pc'>" + (i + 1) + "</span></strong> "); } } } else { if (pageIndex + 1 < 5) { for (int i = 0; i < 5; i++) { sb.Append("<a href='" + url + "'> <span class='pc'>" + (i + 1) + "</span></a> "); if (i == pageIndex) { sb.Append("<strong><span class='pc'>" + (i + 1) + "</span></strong> "); } } sb.Append("…<a href='" + url + "'> <span class='pc'>" + pageCount + "</span></a> "); } else if (pageIndex + 1 > pageCount - 4) { sb.Append("<a href='" + url + "'> <span class='pc'>" + 1 + "</span></a> …"); for (int i = pageCount - 5; i < pageCount; i++) { sb.Append("<a href='" + url + "'> <span class='pc'>" + (i + 1) + "</span></a> "); if (i == pageIndex) { sb.Append("<strong><span class='pc'>" + (i + 1) + "</span></strong> "); } } } else { sb.Append("<a href='" + url + "'> <span class='pc'>" + 1 + "</span></a> …"); for (int i = pageIndex - 2; i <= pageIndex + 2; i++) { sb.Append("<a href='" + url + "'> <span class='pc'>" + (i + 1) + "</span></a> "); if (pageIndex == i) { sb.Append("<strong><span class='pc'>" + (i + 1) + "</span></strong> "); } } sb.Append("…<a href='" + url + "'> <span class='pc'>" + pageCount + "</span></a> "); } } } if (nextNum <= pageCount - 1) { if (url.IndexOf("?") == -1) { sb.Append("<a href='" + url + "?page=" + nextNum + "' class='n'>下一页></a>"); } else { sb.Append("<a href='" + url + "&page=" + nextNum + "' class='n'>下一页></a>"); } } sb.Append("<span class='nums'>共" + count + "条</span>"); sb.Append("</p>"); pageNav = sb.ToString(); return(dt); }
private void BindModel() { string code = Convert.ToString(Request["billCode"]); DataTable dt = server.GetDataTable("select distinct maincode,typecode,arrdess,travelDate,reasion,travelplan,needAmount,transport,moreThanStandard,reportCode,jiaotongfei,zhusufei,yewuzhaodaifei,huiyifei,yinshuafei,qitafei,sendDept,b.billCode as billCode,b.billName as billName, convert(varchar(10),b.billdate,121) as billDate,b.billDept as billDept ,b.billje as billje ,b.billuser from bill_travelApplication a, bill_main b where a.mainCode=b.billCode and a.mainCode='" + code + "'", null); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; lb_bm.Text = server.GetCellValue("select '['+deptcode+']'+deptName from bill_departments where deptcode='" + ObjectToStr(dr["sendDept"]) + "'"); lb_billDate.Text = Convert.ToDateTime(ObjectToStr(dr["billDate"])).ToString("yyyy-MM-dd"); lb_billUser.Text = server.GetCellValue("select '['+usercode+']'+userName from bill_users where usercode='" + ObjectToStr(dr["billuser"]) + "'"); lb_travelDate.Text = ObjectToStr(dr["travelDate"]); string persons = ""; DataTable pdt = server.GetDataTable("select travelPersionCode as p from bill_travelApplication where mainCode='" + code + "' ", null); if (pdt.Rows.Count > 0) { StringBuilder sb = new StringBuilder(); sb.Append("<h5>出差人<h5>"); sb.Append("<table class='tab-hs' style='color: Black; font-family: 微软雅黑;'>"); for (int i = 0; i < pdt.Rows.Count; i++) { DataTable itemdt = server.GetDataTable("select '['+usercode+']'+userName as userCode,(select '['+deptCode+']'+deptName from bill_departments where deptCode=userDept) as deptCode from bill_users where usercode='" + pdt.Rows[i]["p"].ToString() + "'", null); //sb.Append("<tr><td class='tdborder'>" + itemdt.Rows[0]["userCode"] + ": " + itemdt.Rows[0]["deptCode"] + "</td><td class='tdborder'></tr>"); sb.Append("<tr><td class='tdborder' style='min-width:120px'>" + itemdt.Rows[0]["userCode"] + "</td><td class='tdborder'>" + itemdt.Rows[0]["deptCode"] + "</td><td class='tdborder'></tr>"); } sb.Append("</table>"); persons = sb.ToString(); } chr.InnerHtml = persons; lb_address.Text = ObjectToStr(dr["arrdess"]); lb_reasion.Text = ObjectToStr(dr["reasion"]); lb_plan.Text = ObjectToStr(dr["travelplan"]); lb_zje.Text = NullToNUm(dr["billje"]); lb_jtf.Text = NullToNUm(dr["jiaotongfei"]); lb_zsf.Text = NullToNUm(dr["zhusufei"]); lb_zdf.Text = NullToNUm(dr["yewuzhaodaifei"]); lb_hyf.Text = NullToNUm(dr["huiyifei"]); lb_ysf.Text = NullToNUm(dr["yinshuafei"]); lb_qt.Text = NullToNUm(dr["qitafei"]); lb_jtgj.Text = ObjectToStr(dr["transport"]); lb_isbz.Text = ObjectToStr(dr["moreThanStandard"]) == "0"?"否":"是"; } string type = Request["type"]; if (!string.IsNullOrEmpty(type)) { if (type == "View") { aduittr.Visible = false; btn_audit.Visible = false; btn_cancel.Visible = false; //判断是否已提交 DataTable dt1 = server.GetDataTable("select * from workflowrecord where billCode='" + code + "'", null); if (dt1.Rows.Count > 0) { btn_submit.Visible = false; btn_delete.Visible = false; if (dt1.Rows[0]["rdState"].ToString() == "3") { btn_revoke.Visible = true; } } } if (type == "audit") { btn_submit.Visible = false; btn_delete.Visible = false; aduittr.Visible = true; } } }
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer) { HiddenField hf = e.Item.FindControl("hfCode") as HiddenField; if (Request["isdz"].ToString() == "1") { hf = e.Item.FindControl("hfname") as HiddenField; } string code = hf.Value.Trim(); HiddenField billdate = e.Item.FindControl("hiddatetime") as HiddenField; HiddenField hiddeptCode = e.Item.FindControl("hidbillDept") as HiddenField; string billDate = billdate.Value; string deptCode = hiddeptCode.Value; if (!string.IsNullOrEmpty(code)) { string strsql = @"select mxGuid ,fykm as yskmCode,(select '['+yskmCode+']'+yskmMc as yskm from bill_yskm where yskmCode=f.fykm ) as yskmMc,isnull(je ,0) as je from bill_ybbxmxb_fykm f where 1=1"; if (Request["isdz"].ToString() == "1") { strsql += " and billCode in(select billcode from bill_main where billname=('" + code + "'))"; } else { strsql += " and billCode='" + code + "'"; } DataTable dt = server.GetDataTable(strsql, null); if (dt.Rows.Count > 0) { string strworksql = @"select * from workflowrecord where billCode='" + code + "'"; DataTable workflow = server.GetDataTable(strworksql, null); string status = ""; StringBuilder sb = new StringBuilder(); for (int i = 0; i < dt.Rows.Count; i++) { //预算金额 string strdydj = "02"; deptCode = string.IsNullOrEmpty(deptCode) ? "" : deptCode.Split(']')[0].Trim('['); string kmCode = string.IsNullOrEmpty(dt.Rows[i]["yskmMc"].ToString()) ? "" : dt.Rows[i]["yskmMc"].ToString().Split(']')[0].Trim('['); string gcbh = ysmgr.GetYsgcCode(DateTime.Parse(billDate)); if (!string.IsNullOrEmpty(Request["flowid"])) { if (Request["flowid"].ToString() == "ybbx") { strdydj = "02"; } } decimal ysje = ysje = ysmgr.GetYueYs(gcbh, deptCode, kmCode); //预算金额 decimal hfje = ysmgr.GetYueHf(gcbh, deptCode, kmCode, strdydj); //花费金额 //是否启用销售提成模块 bool hasSaleRebate = new ConfigBLL().GetValueByKey("HasSaleRebate").Equals("1"); decimal syje = ysje - hfje; sb.Append("<div class='div-yskm'>"); sb.Append("<table class='tab-yskm'>"); //sb.Append("<tr><td class='tdOdd'>费用科目:</td><td>" + Convert.ToString(dt.Rows[i]["yskmMc"]) + "</td></tr>"); sb.Append("<tr><td>" + Convert.ToString(dt.Rows[i]["yskmMc"]) + "预算金额:¥(" + Convert.ToDecimal(ysje).ToString("N02") + ") 剩余金额:¥(" + Convert.ToDecimal(syje).ToString("N02") + ")" + "报销金额:¥(" + Convert.ToDecimal(dt.Rows[i]["je"]).ToString("N02") + ")</td></tr>"); sb.Append("</table>"); sb.Append("</div>"); DataTable temp = server.GetDataTable("select (select '['+deptCode+']'+deptName from bill_departments where deptCode=a.deptCode) as Dept,isnull(je,0) as je from bill_ybbxmxb_fykm_dept a where kmmxGuid ='" + Convert.ToString(dt.Rows[i]["mxGuid"]) + "'", null); if (temp.Rows.Count > 0) { sb.Append("<div class='div-hs'>"); sb.Append("<h5>核算部门</h5>"); sb.Append("<table class='tab-hs ItemTable'>"); // sb.Append("<tr><th class='tdOdd'>部门</th><th>核算金额</th></tr>"); for (int j = 0; j < temp.Rows.Count; j++) { sb.Append("<tr><td class='tdOdd'>" + Convert.ToString(temp.Rows[j]["Dept"]) + ": " + Convert.ToDecimal(temp.Rows[j]["je"]).ToString("N02") + "¥</td></tr>"); } sb.Append("</table>"); sb.Append("</div>"); } temp = server.GetDataTable("select distinct '['+b.xmCode+']'+xmName as xmCode,isnull(je,0) as je from bill_ybbxmxb_hsxm a,bill_xm b where a.xmcode=b.xmcode and kmmxGuid='" + Convert.ToString(dt.Rows[i]["mxGuid"]) + "'", null); if (temp.Rows.Count > 0) { sb.Append("<div class='div-hs'>"); sb.Append("<h5>核算项目</h5>"); sb.Append("<table class='tab-hs ItemTable'>"); // sb.Append("<tr><th class='tdOdd'>项目</th><th>核算金额</th></tr>"); for (int j = 0; j < temp.Rows.Count; j++) { sb.Append("<tr><td class='tdOdd'>" + Convert.ToString(temp.Rows[j]["xmCode"]) + ": " + Convert.ToDecimal(temp.Rows[j]["je"]).ToString("N02") + "¥</td></tr>"); } sb.Append("</table>"); sb.Append("</div>"); } } if (workflow.Rows.Count == 0) { sb.Append("<div class='checkStatus' ><lable>审批状态:未提交</lable></div>"); } else { status = workflow.Rows[0]["rdState"].ToString(); if (status == "1") { WorkFlowRecordManager bll = new WorkFlowRecordManager(); string state = bll.WFState(code); sb.Append("<div class='checkStatus' ><lable>审批状态:" + state + "</lable></div>"); } else if (status == "2") { sb.Append("<div class='checkStatus'><lable>审批状态:审核通过</lable></div>"); } else if (status == "3") { string flowid = server.GetCellValue("select flowid from bill_main where billCode='" + code + "'"); sb.Append("<div class='checkStatus'><lable>审批状态:驳回</lable></div>"); sb.Append("<div style='text-align:center'><a data-role='button' data-inline='true' data-theme='d' onclick=\"RevokeCheck(this,'" + flowid + "','" + code + "')\"><img src='../images/metro/Editor.png' />审核撤销</a></div>"); } } Label lb = e.Item.FindControl("lbmx") as Label; lb.Text = sb.ToString(); HtmlContainerControl hcc = e.Item.FindControl("optionDiv") as HtmlContainerControl; if (status == "3") { hcc.Attributes.CssStyle.Add("display", "none"); } else if (!string.IsNullOrEmpty(status)) { hcc.Visible = false; } } } } }
private void BindData() { ltrTitle.Text = GetTitleByFlowid(Request["flowid"]); string code = Convert.ToString(Request["billCode"]); string strisdz = ""; if (!string.IsNullOrEmpty(Request["isdz"])) { strisdz = Request["isdz"].ToString(); } if (!string.IsNullOrEmpty(code)) { DataTable dt = new DataTable(); if (strisdz == "1") { dt = server.GetDataTable("select a.billCode,a.billName,convert(varchar(10),a.billDate,121) as billDate,isnull((select '['+userCode+']'+userName from bill_users where usercode=a.billUser),a.billUser) as billuser,isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=a.billDept),a.billDept)as billDept,(case a.isgk when '1' then '是' else '否' end ) as isgk, isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=a.gkdept),a.gkdept)as gkdept,isnull((select dicName from bill_dataDic where dicType='02' and dicCode=b.bxmxlx),b.bxmxlx) as bxmxlx,b.bxzy,b.bxsm,a.billje,b.note0 as xyxx,b.note1 as bxfy,b.Bxrzh from bill_main a,bill_ybbxmxb b where a.billCode=b.billCode and a.billname=@code", new SqlParameter[] { new SqlParameter("@code", code) }); } else { dt = server.GetDataTable("select a.billCode,a.billName,convert(varchar(10),a.billDate,121) as billDate,isnull((select '['+userCode+']'+userName from bill_users where usercode=a.billUser),a.billUser) as billuser,isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=a.billDept),a.billDept)as billDept,(case a.isgk when '1' then '是' else '否' end ) as isgk, isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=a.gkdept),a.gkdept)as gkdept,isnull((select dicName from bill_dataDic where dicType='02' and dicCode=b.bxmxlx),b.bxmxlx) as bxmxlx,b.bxzy,b.bxsm,a.billje from bill_main a,bill_ybbxmxb b where a.billCode=b.billCode and a.billCode=@code", new SqlParameter[] { new SqlParameter("@code", code) }); } if (dt.Rows.Count > 0) { lbBillCode.Text = Convert.ToString(dt.Rows[0]["billName"]); lbBillData.Text = Convert.ToString(dt.Rows[0]["billDate"]); lbBillUser.Text = Convert.ToString(dt.Rows[0]["billUser"]); lbBillDept.Text = Convert.ToString(dt.Rows[0]["billDept"]); lbIsgk.Text = Convert.ToString(dt.Rows[0]["isgk"]); if (lbIsgk.Text == "否") { tdgk.Visible = false; } lbGkdept.Text = Convert.ToString(dt.Rows[0]["gkdept"]); lbBillType.Text = Convert.ToString(dt.Rows[0]["bxmxlx"]); lbBxzy.Text = Convert.ToString(dt.Rows[0]["bxzy"]); lbBxsm.Text = Convert.ToString(dt.Rows[0]["bxsm"]); lbBillje.Text = Convert.ToDecimal(dt.Rows[0]["billje"]).ToString("N02"); //录入信息 string[] arrxyxx = dt.Rows[0]["xyxx"].ToString().Split(new string[] { "|&|" }, StringSplitOptions.None); if (arrxyxx.Length > 1) { if (!string.IsNullOrEmpty(arrxyxx[0])) { lblszfx.Text = arrxyxx[0]; } if (!string.IsNullOrEmpty(arrxyxx[1])) { lblxyxm.Text = arrxyxx[1]; } if (!string.IsNullOrEmpty(arrxyxx[2])) { lblsznj.Text = arrxyxx[2]; } if (!string.IsNullOrEmpty(arrxyxx[3])) { lblxybh.Text = arrxyxx[3]; } if (!string.IsNullOrEmpty(arrxyxx[4])) { lblqdsj.Text = arrxyxx[4]; } } string[] arr = dt.Rows[0]["Bxrzh"].ToString().Split(new string[] { "|&|" }, StringSplitOptions.None); if (arr.Length > 1) { if (arr.Length == 3) { lblhm.Text = arr[1]; lbljhzh.Text = arr[0]; } else if (arr.Length == 2) { lblhm.Text = arr[1]; lbljhzh.Text = arr[0]; } } //报销费用 string[] arrbxfy = dt.Rows[0]["bxfy"].ToString().Split(new string[] { "|&|" }, StringSplitOptions.None); if (arrbxfy.Length > 1) { if (!string.IsNullOrEmpty(arrbxfy[0])) { lblxyfdfy.Text = arrbxfy[0]; } if (!string.IsNullOrEmpty(arrbxfy[1])) { lblyxfks.Text = arrbxfy[1]; } if (!string.IsNullOrEmpty(arrbxfy[2])) { lbldyksdj.Text = arrbxfy[2]; } if (!string.IsNullOrEmpty(arrbxfy[3])) { lblyxffy.Text = arrbxfy[3]; } if (!string.IsNullOrEmpty(arrbxfy[4])) { lblykqtfy.Text = arrbxfy[4]; } } lbMx.Text = GetYskmStr(code); } //显示附件 string fujian = ""; if (strisdz == "1") { string strfjsql = @"select fujian from bill_ybbxmxb where billCode in (select billcode from bill_main where billname='" + code + "')"; fujian = server.GetCellValue(strfjsql); } else { fujian = server.GetCellValue("select fujian from bill_ybbxmxb where billCode ='" + Request["billCode"] + "'"); } if (!string.IsNullOrEmpty(fujian)) { string[] arrTemp = fujian.Split('|'); string[] arrname = arrTemp[0].Split(';'); string[] arrfile = arrTemp[1].Split(';'); for (int i = 0; i < arrname.Count(); i++) { if (!string.IsNullOrEmpty(arrname[i])) { { this.lalFuJian.Text += "<a href='../AFrame/download.aspx?filename=" + Server.UrlEncode(arrname[i]) + "&filepath=" + Server.UrlEncode(arrfile[i]) + "' target='_blank'>" + arrname[i] + "下载;</a>"; } } } } else { this.lalFuJian.Text = "无"; } } string type = Request["type"]; if (!string.IsNullOrEmpty(type)) { if (type == "View") { aduittr.Visible = false; btn_audit.Visible = false; btn_cancel.Visible = false; //判断是否已提交 DataTable dt = server.GetDataTable("select * from workflowrecord where billCode='" + code + "'", null); if (dt.Rows.Count > 0) { btn_submit.Visible = false; btn_delete.Visible = false; if (dt.Rows[0]["rdState"].ToString() == "3") { btn_revoke.Visible = true; } } } if (type == "audit") { btn_submit.Visible = false; btn_delete.Visible = false; aduittr.Visible = true; } } }
private void BindData() { string code = Convert.ToString(Request["billCode"]); if (!string.IsNullOrEmpty(code)) { DataTable dt = server.GetDataTable("select (select top 1 (xmmc) from bill_ysgc a,bill_ysmxb b where a.gcbh=b.gcbh and b.billcode=bill_main.billcode ) as ysgc, billCode,billName,convert(varchar(10),billDate,121) as billDate,isnull((select '['+userCode+']'+userName from bill_users where usercode=billUser),billUser) as billuser,isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=billDept),billDept)as billDept,billje from bill_main where billCode=@code", new SqlParameter[] { new SqlParameter("@code", code) }); if (dt.Rows.Count > 0) { lbBillCode.Text = Convert.ToString(dt.Rows[0]["ysgc"]); lbBillData.Text = Convert.ToString(dt.Rows[0]["billDate"]); lbBillUser.Text = Convert.ToString(dt.Rows[0]["billUser"]); lbBillDept.Text = Convert.ToString(dt.Rows[0]["billDept"]); lbBillje.Text = Convert.ToDecimal(dt.Rows[0]["billje"]).ToString("N02"); lbMx.Text = GetYskmStr(code); } //显示附件 string fujian = ""; fujian = server.GetCellValue(" select note2 from bill_main where billcode='" + code + "'"); if (!string.IsNullOrEmpty(fujian)) { string[] arrTemp = fujian.Split('|'); string[] arrname = arrTemp[0].Split(';'); string[] arrfile = arrTemp[1].Split(';'); for (int i = 0; i < arrname.Length; i++) { if (!string.IsNullOrEmpty(arrname[i])) { { this.lalFuJian.Text += "<a href='../AFrame/download.aspx?filename=" + Server.UrlEncode(arrname[i]) + "&filepath=" + Server.UrlEncode(arrfile[i]) + "' target='_blank'>" + arrname[i] + "下载;</a>"; } } } } else { this.lalFuJian.Text = "无"; } } string type = Request["type"]; if (!string.IsNullOrEmpty(type)) { if (type == "View") { aduittr.Visible = false; btn_audit.Visible = false; btn_cancel.Visible = false; //判断是否已提交 DataTable dt = server.GetDataTable("select * from workflowrecord where billCode='" + code + "'", null); if (dt.Rows.Count > 0) { btn_submit.Visible = false; btn_delete.Visible = false; if (dt.Rows[0]["rdState"].ToString() == "3") { btn_revoke.Visible = true; } } } if (type == "audit") { btn_submit.Visible = false; btn_delete.Visible = false; aduittr.Visible = true; } } }
private void BindData() { ltrTitle.Text = GetTitleByFlowid(Request["flowid"]); string code = Convert.ToString(Request["Code"]); string strisdz = ""; if (!string.IsNullOrEmpty(Request["isdz"])) { strisdz = Request["isdz"].ToString(); } if (!string.IsNullOrEmpty(code)) { DataTable dt = new DataTable(); //if (strisdz == "1") //{ // dt = server.GetDataTable("select a.billCode,a.billName,convert(varchar(10),a.billDate,121) as billDate,isnull((select '['+userCode+']'+userName from bill_users where usercode=a.billUser),a.billUser) as billuser,isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=a.billDept),a.billDept)as billDept,(case a.isgk when '1' then '是' else '否' end ) as isgk, isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=a.gkdept),a.gkdept)as gkdept,isnull((select dicName from bill_dataDic where dicType='02' and dicCode=b.bxmxlx),b.bxmxlx) as bxmxlx,b.bxzy,b.bxsm,a.billje,b.note0 as xyxx,b.note1 as bxfy,b.Bxrzh from bill_main a,bill_ybbxmxb b where a.billCode=b.billCode and a.billname=@code", new SqlParameter[] { new SqlParameter("@code", code) }); //} //else //{ dt = server.GetDataTable("select a.billCode,a.billName,a.BillName2,a.Note2,convert(varchar(10),a.billDate,121) as billDate,isnull((select '['+userCode+']'+userName from bill_users where usercode=a.billUser),a.billUser) as billuser,isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=a.billDept),a.billDept)as billDept,(case a.isgk when '1' then '是' else '否' end ) as isgk, isnull((select '['+deptCode+']'+deptname from bill_departments where deptCode=a.gkdept),a.gkdept)as gkdept,a.billje from bill_main a where a.billCode=@code", new SqlParameter[] { new SqlParameter("@code", code) }); //} if (dt.Rows.Count > 0) { lbBillCode.Text = Convert.ToString(dt.Rows[0]["billName"]); lbBillData.Text = Convert.ToString(dt.Rows[0]["billDate"]); lbBillUser.Text = Convert.ToString(dt.Rows[0]["billuser"]); lbBillDept.Text = Convert.ToString(dt.Rows[0]["billDept"]); lbBillje.Text = Convert.ToDecimal(dt.Rows[0]["billje"]).ToString("N02"); txtSm.Text = Convert.ToString(dt.Rows[0]["BillName2"]); lbBxsm.Text = Convert.ToString(dt.Rows[0]["Note2"]); } //显示附件 string fujian = ""; //if (strisdz == "1") //{ fujian = server.GetCellValue("select top 1 note3 from bill_main where billcode='" + code + "'"); // string strfjsql = @"select fujian from bill_ybbxmxb where billCode in (select billcode from bill_main where billname='" + code + "')"; // fujian = server.GetCellValue(strfjsql); //} //else //{ //fujian = server.GetCellValue("select fujian from bill_ybbxmxb where billCode ='" + Request["billCode"] + "'"); // } if (!string.IsNullOrEmpty(fujian)) { string[] arrTemp = fujian.Split('|'); string[] arrname = arrTemp[0].Split(';'); string[] arrfile = arrTemp[1].Split(';'); for (int i = 0; i < arrname.Count(); i++) { if (!string.IsNullOrEmpty(arrname[i])) { { this.lalFuJian.Text += "<a href='../AFrame/download.aspx?filename=" + Server.UrlEncode(arrname[i]) + "&filepath=" + Server.UrlEncode(arrfile[i]) + "' target='_blank'>" + arrname[i] + "下载;</a>"; } } } } else { this.lalFuJian.Text = "无"; } } string type = Request["type"]; if (!string.IsNullOrEmpty(type)) { if (type == "View") { aduittr.Visible = false; btn_audit.Visible = false; btn_cancel.Visible = false; //判断是否已提交 DataTable dt = server.GetDataTable("select * from workflowrecord where billCode='" + code + "'", null); if (dt.Rows.Count > 0) { btn_submit.Visible = false; btn_delete.Visible = false; if (dt.Rows[0]["rdState"].ToString() == "3") { btn_revoke.Visible = true; } } } if (type == "audit") { btn_submit.Visible = false; btn_delete.Visible = false; aduittr.Visible = true; } } }