protected void Unnamed_Click(object sender, EventArgs e) { try { publicClass.bill bill = new publicClass.bill(Convert.ToInt32(((Button)sender).CommandArgument)); if (bill.Payfrom != _uer.Udep_id) { throw new Exception("无权删除此票据!"); } string cmd = "delete from bill where bill_id=@bill_id"; publicClass.DS_input ip = new publicClass.DS_input(); ip._cmd = cmd; ip._par_name = new string[] { "@bill_id" }; ip._par_type = new SqlDbType[] { SqlDbType.BigInt }; ip._par_val = new object[] { ((Button)sender).CommandArgument }; publicClass.Dosql ds = new publicClass.Dosql(); publicClass.DS_input[] i = { ip }; ds.DoNoRe(i); bill_list_creat(); } catch (Exception ex) { publicClass.calljs.alert(this, ex.Message); } }
protected void flowend_Click(object sender, EventArgs e) { try { string del = string.Format("delete from op where bill_id={0}", _bill.Bill_id); string up = string.Format("update bill set op=1 where bill_id={0}", _bill.Bill_id); publicClass.Dosql ds = new publicClass.Dosql(); publicClass.DS_input[] ips = new publicClass.DS_input[2]; ips[0] = new publicClass.DS_input(); ips[1] = new publicClass.DS_input(); ips[0]._cmd = del; ips[1]._cmd = up; ips[0]._par_name = ips[1]._par_name = new string[] { }; ips[0]._par_type = ips[1]._par_type = new SqlDbType[] { }; ips[0]._par_val = ips[1]._par_val = new object[] { }; ds.DoNoRe(ips); startup(); } catch { } finally { ispower(); oplist(); } }
public void save() { try { if (_key_id != -1) { string cmdstr = "update [key] set key_word=@key_word,uer_id=@uer_id,state=@state,SN=@SN where key_id=" + _key_id; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@key_word", "@uer_id", "@state", "@SN" }; input._par_type = new SqlDbType[] { SqlDbType.Text, SqlDbType.BigInt, SqlDbType.Bit, SqlDbType.Text }; input._par_val = new object[] { _key_word, _uer_id, _state, _sn }; DS_input[] iii = { input }; ds.DoNoRe(iii); } else { throw new Exception("不能新建KEY!"); } } catch (Exception ex) { throw ex; } }
public void Save() { try { if (_edep_id != -1) { string cmdstr = "update [exc_dep] set dep_name=@dep_name,dep_no=@dep_no,summary=@summary,dep_id=@dep_id,state=@state where dep_id=" + _dep_id; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@dep_name", "@dep_no", "@summary", "@dep_id", "@state" }; input._par_type = new SqlDbType[] { SqlDbType.Text, SqlDbType.Text, SqlDbType.Text, SqlDbType.BigInt, SqlDbType.Bit }; input._par_val = new object[] { _edep_name, _edep_no, _summary, _dep_id, _state }; DS_input[] iii = { input }; ds.DoNoRe(iii); } else { string cmdstr = "insert into [exc_dep] values(@dep_name,@dep_no,@summary,@dep_id,@state)"; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@dep_name", "@dep_no", "@summary", "@dep_id", "@state" }; input._par_type = new SqlDbType[] { SqlDbType.Text, SqlDbType.Text, SqlDbType.Text, SqlDbType.BigInt, SqlDbType.Bit }; input._par_val = new object[] { _edep_name, _edep_no, _summary, _dep_id, _state }; DS_input[] iii = { input }; ds.DoNoRe(iii); } } catch (Exception ex) { throw ex; } }
protected void Unnamed_Click2(object sender, EventArgs e) { try { if (_bill.Op != _uer.Ulvl) { throw new Exception("lvl错误!"); } if (sigs.SelectedValue == "-1" && _bill.Op <= 2) { throw new Exception("印章选择错误!"); } string cmd_insert_op = string.Format("insert into op values({0},{1},'{2}',{3},{4},{5},{6},{7},'{8}')", _bill.Bill_id, _uer.Uid, DateTime.Now.ToShortDateString(), _uer.Ulvl, -1, Convert.ToInt32(sigs.SelectedValue), -1, -1, summary.Text); string cmd_up_bill = string.Format("update bill set op ={0} where bill_id={1}", _bill.Op + 1, _bill.Bill_id); publicClass.Dosql ds = new publicClass.Dosql(); publicClass.DS_input[] ips = new publicClass.DS_input[2]; ips[0] = new publicClass.DS_input(); ips[1] = new publicClass.DS_input(); ips[0]._cmd = cmd_insert_op; ips[1]._cmd = cmd_up_bill; ips[0]._par_name = ips[1]._par_name = new string[] { }; ips[0]._par_type = ips[1]._par_type = new SqlDbType[] { }; ips[0]._par_val = ips[1]._par_val = new object[] { }; ds.DoNoRe(ips); startup(); } catch (Exception ex) { } finally { ispower(); oplist(); } }
public void Save() { try { if (_sig_id != -1) { string cmdstr = "update [sig] set dep_id=@dep_id,state=@state,sig_word=@sig_word,type=@type,lvl=@lvl where sig_id=" + _sig_id; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@dep_id", "@state", "@sig_word", "@type", "@lvl" }; input._par_type = new SqlDbType[] { SqlDbType.BigInt, SqlDbType.Bit, SqlDbType.Text, SqlDbType.Int, SqlDbType.Int }; input._par_val = new object[] { _dep_id, _type, _sig_word, _type, _lvl }; DS_input[] iii = { input }; ds.DoNoRe(iii); } else { string cmdstr = "insert into [sig] values( @dep_id, @state, @sig_word, @type, @lvl )"; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@dep_id", "@state", "@sig_word", "@type", "@lvl" }; input._par_type = new SqlDbType[] { SqlDbType.BigInt, SqlDbType.Bit, SqlDbType.Text, SqlDbType.Int, SqlDbType.Int }; input._par_val = new object[] { _dep_id, _type, _sig_word, _type, _lvl }; DS_input[] iii = { input }; ds.DoNoRe(iii); } } catch (Exception ex) { throw ex; } }
public void save() { try { if (_note_id != -1) { string cmdstr = "update [note] set word=@word where uer_id=" + _note_id; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@word" }; input._par_type = new SqlDbType[] { SqlDbType.Text }; input._par_val = new object[] { _word }; DS_input[] iii = { input }; ds.DoNoRe(iii); } else { string cmdstr = "insert into [note] values(@word)"; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@word" }; input._par_type = new SqlDbType[] { SqlDbType.Text }; input._par_val = new object[] { _word }; DS_input[] iii = { input }; ds.DoNoRe(iii); } } catch (Exception ex) { throw ex; } }
public void Save() { try { if (_id != -1 & _exist) { string cmdstr = "update [uer] set psw=@psw,uer_name=@uer_name,uer_no=@uer_no,dep_id=@dep_id,state=@state,uer_lvl=@uer_lvl where uer_id=" + _id; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@psw", "@uer_name", "@uer_no", "@dep_id", "@state", "@uer_lvl" }; input._par_type = new SqlDbType[] { SqlDbType.Text, SqlDbType.Text, SqlDbType.Text, SqlDbType.BigInt, SqlDbType.Bit, SqlDbType.BigInt }; input._par_val = new object[] { _psw, _name, _no, _dep_id, _state, _lvl }; DS_input[] iii = { input }; ds.DoNoRe(iii); } else { string cmdstr = "insert into [uer] values(@psw,@uer_name,@uer_no,@dep_id,@state,@uer_lvl)"; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@psw", "@uer_name", "@uer_no", "@dep_id", "@state", "@uer_lvl" }; input._par_type = new SqlDbType[] { SqlDbType.Text, SqlDbType.Text, SqlDbType.Text, SqlDbType.BigInt, SqlDbType.Bit, SqlDbType.BigInt }; input._par_val = new object[] { _psw, _name, _no, _dep_id, _state, _lvl }; DS_input[] iii = { input }; ds.DoNoRe(iii); } } catch (Exception ex) { throw ex; } }
public void save() { try { if (_bill_id != -1) { string cmdstr = "update [bill] set bill_id_head=@bill_id_head"; cmdstr += ",bill_id_body=@bill_id_body"; cmdstr += ",bill_type=@bill_type"; cmdstr += ",payfrom=@payfrom"; cmdstr += ",payto=@payto"; cmdstr += ",amount=@amount"; cmdstr += ",summary=@summary"; cmdstr += ",maker=@maker"; cmdstr += ",make_date=@make_date"; cmdstr += ",isdel=@isdel"; cmdstr += ",iscx=@iscx"; cmdstr += ",prnt=@prnt"; cmdstr += ",op=@op"; //cmdstr += ",dep_id=@depid"; cmdstr += ",secret=@secret"; cmdstr += ",payfrom_no=@payfrom_no"; cmdstr += ",payto_no=@payto_no"; cmdstr += ",isfiled=@isfiled"; cmdstr += ",truedate=@true_date"; cmdstr += " where bill_id=" + _bill_id; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@bill_id_head", "@bill_id_body", "@bill_type", "@payfrom", "@payto", "@amount", "@summary", "@maker", "@make_date", "@isdel", "@iscx", "@prnt", "@op", "@secret", "@payfrom_no", "@payto_no", "@isfiled", "@true_date" }; input._par_type = new SqlDbType[] { SqlDbType.Text, SqlDbType.Int, SqlDbType.Int, SqlDbType.BigInt, SqlDbType.BigInt, SqlDbType.Decimal, SqlDbType.Text, SqlDbType.BigInt, SqlDbType.Date, SqlDbType.Bit, SqlDbType.Bit, SqlDbType.BigInt, SqlDbType.BigInt, SqlDbType.Text, SqlDbType.BigInt, SqlDbType.BigInt, SqlDbType.Bit, SqlDbType.Date }; input._par_val = new object[] { _bill_id_head, _bill_id_body, _bill_type, _payfrom, _payto, _amount, _summary, _maker, _make_date, _isdel, _iscx, _prnt, _op, _secret, _payfrom_no, _payto_no, _isfiled, _true_date }; DS_input[] iii = { input }; ds.DoNoRe(iii); } else { string cmdstr = "insert into [bill] values(@bill_id_head,@bill_id_body,@bill_type, @payfrom,@payto,@amount,@summary,@maker,@make_date,@isdel,@iscx,@prnt,@op,@secret,@payfrom_no,@payto_no,@isfiled,@true_date)"; Dosql ds = new Dosql(); DS_input input = new DS_input(); input._cmd = cmdstr; input._par_name = new string[] { "@bill_id_head", "@bill_id_body", "@bill_type", "@payfrom", "@payto", "@amount", "@summary", "@maker", "@make_date", "@isdel", "@iscx", "@prnt", "@op", "@secret", "@payfrom_no", "@payto_no", "@isfiled", "@true_date" }; input._par_type = new SqlDbType[] { SqlDbType.Text, SqlDbType.Int, SqlDbType.Int, SqlDbType.BigInt, SqlDbType.BigInt, SqlDbType.Decimal, SqlDbType.Text, SqlDbType.BigInt, SqlDbType.Date, SqlDbType.Bit, SqlDbType.Bit, SqlDbType.Int, SqlDbType.BigInt, SqlDbType.Text, SqlDbType.BigInt, SqlDbType.BigInt, SqlDbType.Bit, SqlDbType.Date }; input._par_val = new object[] { _bill_id_head, _bill_id_body, _bill_type, _payfrom, _payto, _amount, _summary, _maker, _make_date, _isdel, _iscx, _prnt, _op, _secret, _payfrom_no, _payto_no, _isfiled, _true_date }; DS_input[] iii = { input }; ds.DoNoRe(iii); } } catch (Exception ex) { throw ex; } }
protected void stop_Click(object sender, EventArgs e) { Boolean bit = ((Button)sender).Text == "停用" ? false : true; string cmd = "update exc_dep set state = @state where edep_id = @edep_id"; publicClass.DS_input input = new publicClass.DS_input(); input._cmd = cmd; input._par_name = new string[] { "@state", "@edep_id" }; input._par_type = new SqlDbType[] { SqlDbType.Bit, SqlDbType.BigInt }; input._par_val = new object[] { bit, ((Button)sender).CommandArgument }; publicClass.Dosql dosql = new publicClass.Dosql(); dosql.DoNoRe(new publicClass.DS_input[] { input }); }
protected void save_Click(object sender, EventArgs e) { try { string cmd = string.Format("update sig set dep_id = {0},[state]={1},lvl = {2} where sig_id ={3}", this.dep_list.SelectedValue, this.state.SelectedValue, this.lvl.SelectedValue, this.sig_list.SelectedValue); publicClass.Dosql ds = new publicClass.Dosql(); publicClass.DS_input ip = new publicClass.DS_input(); ip._cmd = cmd; ip._par_name = new string[] { }; ip._par_type = new SqlDbType[] { }; ip._par_val = new object[] { }; ds.DoNoRe(new publicClass.DS_input[] { ip }); } catch { } }
protected void save_Click(object sender, EventArgs e) { try { string new_date_word = (temp[1] == 12 ? temp[0] + 1 : temp[0]).ToString() + "-" + (temp[1] == 12 ? 1 : temp[1] + 1).ToString(); string new_date = new publicClass.MSE(Convert.ToDateTime(new_date_word + "-20")).E.ToShortDateString(); decimal qcye, bqsr, bqzc, qmye; int no_id; List <publicClass.DS_input> ips_list = new List <publicClass.DS_input>(); foreach (DataRow r in ((DataTable)this.m_info.DataSource).Rows) { no_id = Convert.ToInt32(r[0]); qcye = Convert.ToDecimal(r[4]); bqsr = Convert.ToDecimal(r[5]); bqzc = Convert.ToDecimal(r[6]); qmye = Convert.ToDecimal(r[7]); if (qcye != 0 || bqsr != 0 || bqzc != 0 || qmye != 0) { publicClass.DS_input ip = new publicClass.DS_input(); ip._cmd = "insert into m_info values(@no_id,@ms_date,@qcye,@bqsr,@bqzc,@dep_id,@op_id,@qmye,@data_word)"; ip._par_name = new string[] { "@no_id", "@ms_date", "@qcye", "@bqsr", "@bqzc", "@dep_id", "@op_id", "@qmye", "@data_word" }; ip._par_type = new SqlDbType[] { SqlDbType.BigInt, SqlDbType.Date, SqlDbType.Decimal, SqlDbType.Decimal, SqlDbType.Decimal, SqlDbType.BigInt, SqlDbType.BigInt, SqlDbType.Decimal, SqlDbType.Text }; ip._par_val = new object[] { no_id, new_date, qcye, bqsr, bqzc, _uer.Udep_id, _uer.Uid, qmye, new_date_word }; ips_list.Add(ip); } } publicClass.DS_input ip2 = new publicClass.DS_input(); ip2._cmd = string.Format("insert into m_state values ('{0}','{1}',{2})", new_date_word, new_date, _uer.Udep_id); ip2._par_name = new string[] { }; ip2._par_type = new SqlDbType[] { }; ip2._par_val = new object[] { }; ips_list.Add(ip2); publicClass.Dosql ds = new publicClass.Dosql(); ds.DoNoRe(ips_list.ToArray()); } catch (Exception ex) { } finally { creat_summary(); creat_info_list(); } }
protected void filed_Click(object sender, EventArgs e) { try { startup(); if (_bill.Op == 5) { publicClass.Dep dep = new publicClass.Dep(_bill.Payfrom); string head = dep.DeShort + "-" + DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString(); publicClass.exc_dep exc = new publicClass.exc_dep();; if (_bill.Payto != -1) { exc = new publicClass.exc_dep(_bill.Payto); } else { exc.Edep_name = "无"; exc.Edep_no = "无"; } string secret = "Fd:" + new publicClass.Dep(_bill.Payfrom).DeName; secret += "Fn:" + new publicClass.dep_no(_bill.Payfrom_no).No; secret += "A:" + _bill.Amount; secret += "Td:" + exc.Edep_name + "Tn:" + exc.Edep_no; secret += "Ur:" + new publicClass.Uer(_bill.Maker).Uname + "Md:" + _bill.Make_date.ToShortDateString(); string base64 = publicClass.str2base64.to64(secret); publicClass.MSE mse = new publicClass.MSE(_bill.Make_date); string up_str = string.Format("update bill set isfiled=1,bill_id_head='{0}',bill_id_body =(select max(bill_id_body)+1 from bill where make_date between '{1}' and '{2}'),secret='{3}' where bill_id={4} ", head, mse.S.ToShortDateString(), mse.E.ToShortDateString(), base64, _bill.Bill_id); publicClass.DS_input ip = new publicClass.DS_input(); ip._cmd = up_str; ip._par_name = new string[] { }; ip._par_type = new SqlDbType[] { }; ip._par_val = new object[] { }; publicClass.Dosql ds = new publicClass.Dosql(); ds.DoNoRe(new publicClass.DS_input[] { ip }); } } catch { } finally { Response.Redirect("review.aspx"); } }
protected void Unnamed_Click1(object sender, EventArgs e) { try { if (_bill.Op == _uer.Ulvl && _bill.Payfrom == _uer.Udep_id) { string cmd_delop = string.Format("delete from op where lvl={0} and bill_id={1}", _uer.Ulvl - 1, _bill.Bill_id); int new_op = _bill.Op - 1 < 1 ? 1 : _bill.Op - 1; string cmd_upbill = string.Format("update bill set op={0} where bill_id =" + _bill.Bill_id, new_op); publicClass.DS_input ip1 = new publicClass.DS_input(); publicClass.DS_input ip2 = new publicClass.DS_input(); ip1._cmd = cmd_delop; ip2._cmd = cmd_upbill; ip1._par_name = ip2._par_name = new string[] { }; ip1._par_type = ip2._par_type = new SqlDbType[] { }; ip1._par_val = ip2._par_val = new object[] { }; publicClass.Dosql ds = new publicClass.Dosql(); ds.DoNoRe(new publicClass.DS_input[] { ip1, ip2 }); startup(); if (!ds.Sqled) { throw new Exception("票据回退失败!"); } } else { throw new Exception("票据审批流程出错!"); } } catch (Exception ex) { } finally { ispower(); oplist(); } }
protected void back_Click(object sender, EventArgs e) { try { if (m_state == "2018-03") { throw new Exception("期初建账,不可删除!"); } else { string cmd_del_state = string.Format("delete from m_state where m_date_word like '{0}'", m_state); string cmd_del_info = string.Format("delete from M_info where m_date_word like '{0}'", m_state); publicClass.DS_input[] ips = new publicClass.DS_input[2]; ips[0] = new publicClass.DS_input(); ips[0]._cmd = cmd_del_state; ips[0]._par_name = new string[] { }; ips[0]._par_type = new SqlDbType[] { }; ips[0]._par_val = new object[] { }; ips[1] = new publicClass.DS_input(); ips[1]._cmd = cmd_del_info; ips[1]._par_name = new string[] { }; ips[1]._par_type = new SqlDbType[] { }; ips[1]._par_val = new object[] { }; publicClass.Dosql ds = new publicClass.Dosql(); ds.DoNoRe(ips); } } catch (Exception ex) { } finally { creat_summary(); creat_info_list(); } }
protected void savenew_Click(object sender, EventArgs e) { try { publicClass.DS_input inp = new publicClass.DS_input(); inp._cmd = "insert into depno values (@no_name,@no,@state,@dep_id,@summary)"; inp._par_name = new string[] { "@no_name", "@no", "@state", "@dep_id", "@summary" }; inp._par_type = new SqlDbType[] { SqlDbType.Text, SqlDbType.Text, SqlDbType.Bit, SqlDbType.BigInt, SqlDbType.Text }; inp._par_val = new object[] { this.no_name.Text, no.Text, false, this.headbar.Uer.Udep_id, summary.Text }; publicClass.Dosql dosql = new publicClass.Dosql(); dosql.DoNoRe(new publicClass.DS_input[] { inp }); this.new_dep_div.Visible = false; this.list_tab.Visible = true; this.no_name.Text = ""; this.no.Text = ""; this.summary.Text = ""; this.ymbt.Text = "部门账号列表"; } catch { this.ErrStr.Text = "新建账号失败,请确认填写无误!"; } }