protected void Page_Load(object sender, EventArgs e) { _uer = new publicClass.Uer(Convert.ToInt32(Session["uer_id"])); _dep = new publicClass.Dep(_uer.Udep_id); creat_summary(); creat_info_list(); }
protected void Page_Load(object sender, EventArgs e) { try { _uer = new publicClass.Uer(Convert.ToInt32(Session["uer_id"])); _dep = new publicClass.Dep(_uer.Udep_id); string cmd_yj = "select top 1 m_date_word from m_state where 1=1 and m_dep_id= " + _uer.Udep_id + "order by m_s_id desc"; publicClass.MSE mse = new publicClass.MSE(DateTime.Now); string cmd_bysr = string.Format("select case when sum(amount) is null then 0 else sum(amount) end from bill where bill_type=1 and isfiled =1 and make_date between '{0}' and '{1}'", mse.S, mse.E); string cmd_byzc = string.Format("select case when sum(amount) is null then 0 else sum(amount) end from bill where bill_type=2 and isfiled =1 and make_date between '{0}' and '{1}'", mse.S, mse.E);; string cmd_zyzh = "select count(*) from depno where 1=1 and state=1"; string cmd_wldw = "select count(*) from exc_dep where 1=1 and state=1"; string cmd_dy = "select count(*) from bill where isfiled=1 and prnt=0"; string cmd_sp = "select count(*) from bill where op=" + _uer.Ulvl; string cmd_gd = "select count(*) from bill where op=5 and isfiled =0"; string str_where = " and dep_id= " + _uer.Udep_id; if (_uer.Ulvl <= 2) { cmd_bysr += " and payfrom = " + _uer.Udep_id; cmd_byzc += " and payfrom =" + _uer.Udep_id; cmd_zyzh += str_where; cmd_wldw += str_where;; cmd_dy += " and payfrom = " + _uer.Udep_id; cmd_sp += " and payfrom = " + _uer.Udep_id; cmd_gd += " and payfrom = " + _uer.Udep_id; } publicClass.Dosql ds = new publicClass.Dosql(); ds.DoRe(cmd_yj); yj_lab.Text = ds.DtOut.Rows[0][0].ToString(); ds = new publicClass.Dosql(); ds.DoRe(cmd_bysr); bysr_lab.Text = ds.DtOut.Rows[0][0].ToString(); ds = new publicClass.Dosql(); ds.DoRe(cmd_byzc); byzc_lab.Text = ds.DtOut.Rows[0][0].ToString(); ds = new publicClass.Dosql(); ds.DoRe(cmd_zyzh); zyzh_lab.Text = ds.DtOut.Rows[0][0].ToString(); ds = new publicClass.Dosql(); ds.DoRe(cmd_wldw); wldw_lab.Text = ds.DtOut.Rows[0][0].ToString(); ds = new publicClass.Dosql(); ds.DoRe(cmd_dy); dy_lab.Text = ds.DtOut.Rows[0][0].ToString(); ds = new publicClass.Dosql(); ds.DoRe(cmd_sp); sp_lab.Text = ds.DtOut.Rows[0][0].ToString(); ds = new publicClass.Dosql(); ds.DoRe(cmd_gd); gd_lab.Text = ds.DtOut.Rows[0][0].ToString(); dbsx_lal.Text = (Convert.ToInt32(sp_lab.Text) + Convert.ToInt32(dy_lab.Text) + Convert.ToInt32(gd_lab.Text)).ToString(); sz_lab.Text = (Convert.ToDecimal(bysr_lab.Text) - Convert.ToDecimal(byzc_lab.Text)).ToString(); sp_img.Text = string.Format("<div class='bar' style='width:{0}%';></div>", (Convert.ToInt16(sp_lab.Text) * 100 / Convert.ToInt16(dbsx_lal.Text)).ToString()); gd_img.Text = string.Format("<div class='bar' style='width:{0}%';></div>", (Convert.ToInt16(gd_lab.Text) * 100 / Convert.ToInt16(dbsx_lal.Text)).ToString()); dy_img.Text = string.Format("<div class='bar' style='width:{0}%';></div>", (Convert.ToInt16(dy_lab.Text) * 100 / Convert.ToInt16(dbsx_lal.Text)).ToString()); } catch (Exception ex) { } }
protected void newuser_Click(object sender, EventArgs e) { try { publicClass.Uer _uer = new publicClass.Uer(); string[] tep_name = user_name_txtb.Text.Substring(0, user_name_txtb.Text.Length - 1).Split('('); _uer.Uname = tep_name[0]; _uer.Uno = tep_name[1]; _uer.Upsw = psw_txt.Text; _uer.Udep_id = Convert.ToInt32(dep_list.SelectedValue); _uer.Ustate = state.SelectedValue == "1" ? true : false; _uer.Ulvl = Convert.ToInt32(lvl.SelectedValue); _uer.Save(); } catch { } finally { Session["admin_user_list_str"] = null; creat_dep_list(); psw_txt.Text = ""; user_name_txtb.Text = ""; } }
protected void save_Click(object sender, EventArgs e) { _uer = new publicClass.Uer(Convert.ToInt32(Session["uer_id"])); if (this.oldpsw.Text != _uer.Upsw) { publicClass.calljs.alert(this, "原始密码核对失败!"); } else { if (new_psw.Text != new_psw1.Text) { publicClass.calljs.alert(this, "两次输入的新密码不一致!"); } else { if (new_psw.Text.Length < 6) { publicClass.calljs.alert(this, "新密码不能小于6位!"); } else { _uer.Upsw = new_psw.Text; _uer.Save(); publicClass.calljs.alert(this, "密码修改成功!"); } } } }
protected void Page_Load(object sender, EventArgs e) { _uer = new publicClass.Uer(Convert.ToInt32(Session["uer_id"])); _dep = new publicClass.Dep(_uer.Udep_id); if (!IsPostBack) { bill_list_creat(); } }
protected void Page_Load(object sender, EventArgs e) { _uer = new publicClass.Uer(Convert.ToInt32(Session["uer_id"])); if (!IsPostBack) { creat_year_list(DateTime.Now.Year); Mstateinfo(DateTime.Now.Year); } }
protected void Page_Load(object sender, EventArgs e) { _uer = new publicClass.Uer(Convert.ToInt32(Session["uer_id"])); if (!IsPostBack) { Session["depno_list"] = ""; this.new_dep_div.Visible = false; this.ymbt.Text = "部门账号列表"; } }
protected void save_Click(object sender, EventArgs e) { try { publicClass.Uer uer = new publicClass.Uer(Convert.ToInt32(user_list.SelectedValue)); uer.Upsw = psw_txt.Text; uer.Ulvl = Convert.ToInt32(this.lvl.SelectedValue); uer.Ustate = this.state.SelectedValue == "0"?false:true; uer.Udep_id = Convert.ToInt32(this.dep_list.SelectedValue); uer.Save(); } catch (Exception ex) { } }
protected void user_list_SelectedIndexChanged(object sender, EventArgs e) { try { lvl.SelectedIndex = -1; dep_list.SelectedIndex = -1; state.SelectedIndex = -1; publicClass.Uer uer = new publicClass.Uer(Convert.ToInt32(this.user_list.SelectedValue)); foreach (ListItem i in dep_list.Items) { if (i.Value == uer.Udep_id.ToString()) { i.Selected = true; } else { i.Selected = false; } } if (uer.Ustate) { state.SelectedIndex = 0; } else { state.SelectedIndex = 1; } foreach (ListItem i in lvl.Items) { if (i.Value == uer.Ulvl.ToString()) { i.Selected = true; } else { i.Selected = false; } } this.psw_txt.Text = uer.Upsw; } catch { } }
private void InsertImg(PdfContentByte cb, int b_id, AcroFields f1) { try { string cmd_op_list = "select * from op where bill_id=" + b_id; publicClass.Dosql ds = new publicClass.Dosql(); publicClass.sig sig = null; ds.DoRe(cmd_op_list); string oper = "审批人:\n"; foreach (DataRow r in ds.DtOut.Rows) { if (Convert.ToInt16(r["lvl"]) <= 2) { sig = new publicClass.sig(Convert.ToInt32(r["sig_id"])); iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(publicClass.Sigformat.ToImage(sig.Sig_word), new BaseColor(255, 255, 255)); img.Transparency = new int[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; if (Convert.ToInt16(r["lvl"]) == 1) { img.SetAbsolutePosition(100, 80); img.ScaleToFit(100f, 100f); } else { img.SetAbsolutePosition(200, 100); img.ScaleToFit(50f, 50f); } cb.AddImage(img); cb.AddImage(img); } else { } oper += new publicClass.Uer(Convert.ToInt32(r["uer_id"])).Uname + "\n"; } f1.SetField("sp", oper); } catch { } }
protected MemoryStream creatpdf() { string[] cmd = new string[2]; if (Session["bill_preview"] == null) { } else { string billcmd = Session["bill_preview"].ToString(); cmd = billcmd.Split(','); } MemoryStream ms_out = new MemoryStream(); try { publicClass.bill bill = new publicClass.bill(Convert.ToInt32(cmd[0])); publicClass.Dep dep = new publicClass.Dep(bill.Payfrom); publicClass.dep_no dep_no = new publicClass.dep_no(bill.Payfrom_no); publicClass.exc_dep edep = new publicClass.exc_dep(); if (bill.Bill_type == 2) { edep = new publicClass.exc_dep(bill.Payto); } if (cmd[1].ToString() == "1") { //publicClass.sig sig = new publicClass.sig(1); string url = "http://" + Request.Url.Host + ":" + Request.Url.Port + "/billmodel/cd.pdf"; publicClass.Uer maker = new publicClass.Uer(bill.Maker); PdfReader rd = new PdfReader(url); MemoryStream ms = new MemoryStream(); PdfStamper st = new PdfStamper(rd, ms); PdfContentByte cb = st.GetOverContent(1); //iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(publicClass.Sigformat.ToImage(sig.Sig_word), new BaseColor(255, 255, 255)); //img.Transparency = new int[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; //img.SetAbsolutePosition(100, 100); //img.ScaleToFit(100f, 100f); //cb.AddImage(img); //cb.AddImage(img); BaseFont font = BaseFont.CreateFont("c:\\windows\\fonts\\STSONG.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); AcroFields f1 = st.AcroFields; foreach (string x in f1.Fields.Keys) { f1.SetFieldProperty(x, "textfont", font, null); } f1.SetField("ckdw", dep.DeName); f1.SetField("kprq", bill.Make_date.ToShortDateString().ToString()); f1.SetField("jexx", "¥" + bill.Amount.ToString()); f1.SetField("jedx", "人民币: " + publicClass.formatamount.format(bill.Amount)); f1.SetField("ckzh", dep_no.No); f1.SetField("bz", "开户银行:" + dep_no.No_name + "\n说明:" + bill.Summary); f1.SetField("zdr", maker.Uname); string newstr = publicClass.str2base64.to64(publicClass.str2base64.tostr(bill.Secret) + "Pd:" + DateTime.Now.ToShortDateString()); f1.SetField("mm", newstr); f1.SetField("pjbh", bill.Bill_id_head + "-" + bill.Bill_id_body); f1.SetField("kprq", string.Format("{0}年{1}月{2}日", bill.Make_date.Year, bill.Make_date.Month, bill.Make_date.Day)); f1.SetField("dycs", bill.Prnt.ToString()); f1.SetField("dyrq", string.Format("{0}年{1}月{2}日", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day)); InsertImg(cb, bill.Bill_id, f1); st.Writer.CloseStream = false; st.Close(); ms_out = ms; } else { string url = "http://" + Request.Url.Host + ":" + Request.Url.Port + "/billmodel/zp.pdf"; publicClass.Uer maker = new publicClass.Uer(bill.Maker); PdfReader rd = new PdfReader(url); MemoryStream ms = new MemoryStream(); PdfStamper st = new PdfStamper(rd, ms); PdfContentByte cb = st.GetOverContent(1); BaseFont font = BaseFont.CreateFont("c:\\windows\\fonts\\STSONG.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); AcroFields f1 = st.AcroFields; foreach (string x in f1.Fields.Keys) { f1.SetFieldProperty(x, "textfont", font, null); } f1.SetField("fkdw", dep.DeName); f1.SetField("kprq", bill.Make_date.ToShortDateString().ToString()); f1.SetField("fkzh", dep_no.No); f1.SetField("skdw", edep.Edep_name); f1.SetField("skzh", edep.Edep_no); f1.SetField("ckzh", dep_no.No); f1.SetField("xxje", "¥" + bill.Amount.ToString()); f1.SetField("dxje", "人民币: " + publicClass.formatamount.format(bill.Amount)); f1.SetField("bz", "开户银行:" + dep_no.No_name + "\n说明:" + bill.Summary); f1.SetField("zdr", maker.Uname); string newstr = publicClass.str2base64.to64(publicClass.str2base64.tostr(bill.Secret) + "Pd:" + DateTime.Now.ToShortDateString()); f1.SetField("mm", newstr); f1.SetField("pjph", bill.Bill_id_head + "-" + bill.Bill_id_body); f1.SetField("kprq", string.Format("{0}年{1}月{2}日", bill.Make_date.Year, bill.Make_date.Month, bill.Make_date.Day)); f1.SetField("dycs", bill.Prnt.ToString()); f1.SetField("dyrq", string.Format("{0}年{1}月{2}日", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day)); InsertImg(cb, bill.Bill_id, f1); st.Writer.CloseStream = false; st.Close(); ms_out = ms; } } catch (Exception ex) { base_font = BaseFont.CreateFont(Server.MapPath("\\billmodel\\hwst.ttf"), BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); Font font = new Font(base_font); Document doc = new Document(PageSize.A5.Rotate()); PdfWriter wr = PdfWriter.GetInstance(doc, ms_out); doc.Open(); doc.Add(new Paragraph(ex.Message, font)); doc.Close(); } return(ms_out); }
protected void Page_Load(object sender, EventArgs e) { _uer = new publicClass.Uer(Convert.ToInt32(Session["uer_id"])); }
protected void ok_Click(object sender, EventArgs e) { string usbstr = this.usb_sn.Value; string[] usbs = usbstr.Length > 0? usbstr.Substring(1, usbstr.Length - 1).Split(','):new string[] { }; Boolean hasusb = false; try { if (this.valcode_input.Text != Session["valcode"].ToString()) { this.warning.Text = "验证码输入错误,请重试!"; } else { this.warning.Text = ""; DataTable temp = new DataTable(); string cmdstr = "select uer_id from uer where 1=1 and uer_no like '" + this.uer_no.Text + "'"; try { publicClass.Dosql ds = new publicClass.Dosql(); ds.DoRe(cmdstr); if (ds.Sqled) { temp = ds.DtOut; publicClass.Uer _uer = new publicClass.Uer(Convert.ToInt32(temp.Rows[0][0])); publicClass.key _key = new publicClass.key(_uer.Uid); foreach (string str in usbs) { if (_key.Key_word == publicClass.str2base64.to64(str) && _key.State) { hasusb = true; } } //if (!hasusb) { throw new Exception("USBKEY"); } if (this.uer_psw.Text.Equals(_uer.Upsw)) { Session["uer_id"] = _uer.Uid; Session["login"] = "******"; Response.Redirect("index.aspx"); } else { throw new Exception("PSSWORD"); } } else { throw new Exception("USER"); } } catch (Exception ex) { this.warning.Text = "登录信息有误,请核对!——" + ex.Message; } } } catch { } }
protected void startup() { _uer = new publicClass.Uer(Convert.ToInt32(Session["uer_id"])); _bill = new publicClass.bill(Convert.ToInt32(Session["bill_filedinfo_id"].ToString())); _dep = new publicClass.Dep(_uer.Udep_id); }