Beispiel #1
0
 protected void payto_list(string cmd_str = "")
 {
     try
     {
         this.payto_saerch_list.Items.Clear();
         DataTable dt = new DataTable();
         string    cmd;
         if (cmd_str == "")
         {
             cmd = "select * from exc_dep where state = 1 and dep_id = " + _dep.DeId;
         }
         else
         {
             cmd = "select * from exc_dep where state = 1 and dep_id = " + _dep.DeId + "and ( edep_name like '%" + cmd_str + "%' or edep_no like '%" + cmd_str + "%')";
         }
         publicClass.Dosql ds = new publicClass.Dosql();
         ds.DoRe(cmd);
         if (ds.Sqled)
         {
             dt = ds.DtOut;
             foreach (DataRow r in dt.Rows)
             {
                 ListItem lit = new ListItem();
                 lit.Text  = r["edep_name"].ToString() + "(" + r["edep_no"].ToString() + ")";
                 lit.Value = r["edep_id"].ToString();
                 payto_saerch_list.Items.Add(lit);
             }
         }
     }
     catch
     {
         publicClass.calljs.alert(this, "页面参数有误!");
     }
 }
Beispiel #2
0
        protected void format_DropDownList(string _cmd, DropDownList _list, int[]  _txt_index, int val_index, int select_key)
        {
            _list.Items.Clear();
            _list.SelectedIndex = -1;
            publicClass.Dosql ds   = new publicClass.Dosql();
            DataTable         temp = new DataTable();

            ds.DoRe(_cmd);
            if (ds.Sqled)
            {
                temp = ds.DtOut;
            }
            ListItem it = new ListItem();

            it.Text  = "全部";
            it.Value = 0.ToString();
            _list.Items.Add(it);


            foreach (DataRow r in temp.Rows)
            {
                it = new ListItem();
                foreach (int i in _txt_index)
                {
                    it.Text += r[i] + ",";
                }
                it.Text  = it.Text.Substring(0, it.Text.Length - 1);
                it.Value = r[val_index].ToString();
                if (it.Value == select_key.ToString())
                {
                    it.Selected = true;
                }
                _list.Items.Add(it);
            }
        }
Beispiel #3
0
        public Uer(int Uid)
        {
            string cmd = "select * from uer where 1=1 and uer_id=" + Uid;
            Dosql  ds  = new Dosql();

            ds.DoRe(cmd);
            if (ds.Sqled)
            {
                DataTable _dtuser = ds.DtOut;
                if (_dtuser.Rows.Count == 1)
                {
                    _exist  = true;
                    _id     = Convert.ToInt32(_dtuser.Rows[0]["uer_id"]);
                    _lvl    = Convert.ToInt32(_dtuser.Rows[0]["uer_lvl"]);
                    _psw    = _dtuser.Rows[0]["psw"].ToString();
                    _name   = _dtuser.Rows[0]["uer_name"].ToString();
                    _no     = _dtuser.Rows[0]["uer_no"].ToString();
                    _state  = Convert.ToBoolean(_dtuser.Rows[0]["state"]);
                    _dep_id = Convert.ToInt32(_dtuser.Rows[0]["dep_id"]);
                }
            }
            else
            {
                throw new Exception("err on creat uer by id");
            }
        }
Beispiel #4
0
 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;
     }
 }
Beispiel #5
0
 protected void no_list(string icmd = "")
 {
     this.No.Items.Clear();
     try
     {
         this.Payfrom.Text = _dep.DeName;
         DataTable dt = new DataTable();
         string    cmd;
         if (icmd == "")
         {
             cmd = "select * from depno where state = 1 and dep_id = " + _dep.DeId;
         }
         else
         {
             cmd = "select * from depno where state = 1 and dep_id = " + _dep.DeId + "and ( no_name like '%" + icmd + "%' or no like '%" + icmd + "%')";
         }
         publicClass.Dosql ds = new publicClass.Dosql();
         ds.DoRe(cmd);
         if (ds.Sqled)
         {
             dt = ds.DtOut;
             foreach (DataRow r in dt.Rows)
             {
                 ListItem lit = new ListItem();
                 lit.Text  = r["no_name"].ToString() + "(" + r["no"].ToString() + ")";
                 lit.Value = r["no_id"].ToString();
                 No.Items.Add(lit);
             }
         }
     }
     catch
     {
     }
 }
Beispiel #6
0
 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;
     }
 }
Beispiel #7
0
        protected void creat_user_list()
        {
            this.user_list.Items.Clear();
            if (Session["admin_user_list_str"] == null)
            {
                user_list_str = "select * from [uer]";
            }
            else
            {
                user_list_str = Session["admin_user_list_str"].ToString();
            }

            try
            {
                publicClass.Dosql ds = new publicClass.Dosql();
                ds.DoRe(user_list_str);
                if (ds.Sqled)
                {
                    foreach (DataRow r in ds.DtOut.Rows)
                    {
                        ListItem it = new ListItem(r["uer_name"].ToString() + "(" + r["uer_no"].ToString() + ")", r["uer_id"].ToString());
                        this.user_list.Items.Add(it);
                    }
                }
            }
            catch
            {
            }
        }
Beispiel #8
0
        protected void creat_dep_list()
        {
            string cmd;

            if (Session["sigadmin_deplist_cmd"] == null)
            {
                cmd = "select * from dep";
            }
            else
            {
                cmd = Session["sigadmin_deplist_cmd"].ToString();
            }
            try
            {
                publicClass.Dosql ds = new publicClass.Dosql();
                ds.DoRe(cmd);
                if (ds.Sqled)
                {
                    foreach (DataRow r in ds.DtOut.Rows)
                    {
                        ListItem it = new ListItem(r["dep_name"].ToString(), r["dep_id"].ToString());
                        dep_list.Items.Add(it);
                    }
                }
            }
            catch
            {
            }
        }
Beispiel #9
0
 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();
     }
 }
Beispiel #10
0
 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);
     }
 }
Beispiel #11
0
 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();
     }
 }
Beispiel #12
0
 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)
     {
     }
 }
Beispiel #13
0
 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;
     }
 }
Beispiel #14
0
 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;
     }
 }
Beispiel #15
0
 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;
     }
 }
Beispiel #16
0
 protected void creat_sig_list()
 {
     this.sig_list.Items.Clear();
     if (Session["sigadmin_list"] == null)
     {
         list_str = "select * from sig";
     }
     else
     {
         list_str = Session["sigadmin_list"].ToString();
     }
     try
     {
         publicClass.Dosql ds = new publicClass.Dosql();
         ds.DoRe(list_str);
         if (ds.Sqled)
         {
             foreach (DataRow r in ds.DtOut.Rows)
             {
                 ListItem it = new ListItem(r["sig_name"].ToString(), r["sig_id"].ToString());
                 sig_list.Items.Add(it);
             }
         }
     }
     catch (Exception ex)
     { }
 }
Beispiel #17
0
 protected void creat_info_list()
 {
     try
     {
         string            cmd_pde_no_list = "select * from depno where dep_id=" + _uer.Udep_id;
         string            cmd_minfo       = "select * from m_info where dep_id=" + _uer.Udep_id + "and m_date_word like '" + m_state + "'";
         publicClass.Dosql ds = new publicClass.Dosql();
         DataTable         dt_dep_no_list, dt_out, dt_minfo;
         ds.DoRe(cmd_pde_no_list);
         dt_dep_no_list = ds.DtOut;
         ds             = new publicClass.Dosql();
         ds.DoRe(cmd_minfo);
         dt_minfo = ds.DtOut;
         dt_out   = new DataTable();
         dt_out.Columns.Add("no_id");
         dt_out.Columns.Add("no");
         dt_out.Columns.Add("state");
         dt_out.Columns.Add("m_date_word");
         dt_out.Columns.Add("qcye");
         dt_out.Columns.Add("bqsr");
         dt_out.Columns.Add("bqzc");
         dt_out.Columns.Add("qmye");
         foreach (DataRow dr in dt_dep_no_list.Rows)
         {
             DataRow in_dr = dt_out.NewRow();
             in_dr["no_id"]       = dr["no_id"];
             in_dr["no"]          = dr["no"];
             in_dr["state"]       = Convert.ToBoolean(dr["state"])?"启用":"停用";
             in_dr["m_date_word"] = (temp[1] == 12 ? temp[0] + 1 : temp[0]).ToString() + "-" + (temp[1] == 12 ? 1 : temp[1] + 1).ToString();
             DataRow[] r = dt_minfo.Select("no_id=" + dr["no_id"]);
             if (r.Length == 0)
             {
                 in_dr["qcye"] = Convert.ToDecimal("0.00");
             }
             else
             {
                 in_dr["qcye"] = Convert.ToDecimal(r[0][8].ToString());
             }
             publicClass.MSE mse      = new publicClass.MSE(Convert.ToDateTime((temp[1] == 12 ? temp[0] + 1 : temp[0]).ToString() + "-" + (temp[1] == 12 ? 1 : temp[1] + 1).ToString() + "-25"));
             string          cmd_bqsr = string.Format("select sum(amount) from bill where payfrom={0} and payto=-1 and isfiled =1 and make_date between '{1}' and '{2}' and payfrom_no = {3}", _uer.Udep_id, mse.S, mse.E, dr["no_id"]);
             string          cmd_bqzc = string.Format("select sum(amount) from bill where payfrom={0} and payto<>-1 and isfiled =1 and make_date between '{1}' and '{2}' and payfrom_no = {3}", _uer.Udep_id, mse.S, mse.E, dr["no_id"]);
             ds = new publicClass.Dosql();
             ds.DoRe(cmd_bqsr);
             in_dr["bqsr"] = Convert.ToDecimal(ds.DtOut.Rows[0][0].ToString() == ""? "0.00" : ds.DtOut.Rows[0][0].ToString());
             ds            = new publicClass.Dosql();
             ds.DoRe(cmd_bqzc);
             in_dr["bqzc"] = Convert.ToDecimal(ds.DtOut.Rows[0][0].ToString() == "" ? "0.00" : ds.DtOut.Rows[0][0].ToString());
             in_dr["qmye"] = Convert.ToDecimal(in_dr["bqsr"]) + Convert.ToDecimal(in_dr["qcye"]) - Convert.ToDecimal(in_dr["bqzc"]);
             dt_out.Rows.Add(in_dr);
         }
         this.m_info.DataSource = dt_out;
         this.m_info.DataBind();
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #18
0
 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;
     }
 }
Beispiel #19
0
        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 });
        }
Beispiel #20
0
        private void list(string cmd)
        {
            string    cmdstr   = cmd == "" ? "select * from exc_dep where dep_id =" + this.headbar.Uer.Udep_id + "order by edep_id desc": cmd;
            DataTable listdata = new DataTable();

            publicClass.Dosql ds = new publicClass.Dosql();
            ds.DoRe(cmdstr);
            if (ds.Sqled)
            {
                this.Repeater1.DataSource = ds.DtOut;
                this.Repeater1.DataBind();
            }
        }
Beispiel #21
0
 protected void Mstateinfo(int y)
 {
     try
     {
         string            cmd = string.Format("select a.* ,b.no from(select * from m_info where dep_id={0} and ms_date between '{1}-1-01' and '{2}-12-31') a left join depno b on a.no_id =b.no_id  order by a.no_id desc,a.ms_date asc ", _uer.Udep_id, y, y);
         publicClass.Dosql ds  = new publicClass.Dosql();
         ds.DoRe(cmd);
         this.m_info.DataSource = ds.DtOut;
         this.m_info.DataBind();
     }
     catch
     {
     }
 }
Beispiel #22
0
 protected void oplist()
 {
     try
     {
         string            list_str = string.Format("select a.* ,b.uer_name from (select * from op where 1=1 and bill_id={0} )a left join uer b on a.uer_id=b.uer_id order by a.op_id asc", _bill.Bill_id);
         publicClass.Dosql ds       = new publicClass.Dosql();
         ds.DoRe(list_str);
         OP_list.DataSource = ds.DtOut;
         OP_list.DataBind();
     }
     catch
     {
     }
 }
Beispiel #23
0
        public bill(int id)
        {
            string cmd = "select * from bill where 1=1 and bill_id=" + id;
            Dosql  ds  = new Dosql();

            ds.DoRe(cmd);
            if (ds.Sqled)
            {
                DataTable _dtuser = ds.DtOut;
                if (_dtuser.Rows.Count == 1)
                {
                    //int 9
                    _bill_id      = Convert.ToInt32(_dtuser.Rows[0]["bill_id"]);
                    _bill_id_body = Convert.ToInt32(_dtuser.Rows[0]["bill_id_body"]);
                    _bill_type    = Convert.ToInt32(_dtuser.Rows[0]["bill_type"]);
                    _payfrom      = Convert.ToInt32(_dtuser.Rows[0]["payfrom"]);
                    _payto        = Convert.ToInt32(_dtuser.Rows[0]["payto"]);
                    _prnt         = Convert.ToInt32(_dtuser.Rows[0]["prnt"]);
                    _op           = Convert.ToInt32(_dtuser.Rows[0]["op"]);
                    //_dep_id = Convert.ToInt32(_dtuser.Rows[0]["dep_id"]);
                    _payfrom_no = Convert.ToInt32(_dtuser.Rows[0]["payfrom_no"]);
                    _payto_no   = Convert.ToInt32(_dtuser.Rows[0]["payto_no"]);
                    _maker      = Convert.ToInt32(_dtuser.Rows[0]["maker"]);

                    // decimal 1
                    _amount = Convert.ToDecimal(_dtuser.Rows[0]["amount"]);

                    //string 3
                    _bill_id_head = _dtuser.Rows[0]["bill_id_head"].ToString();
                    _summary      = _dtuser.Rows[0]["summary"].ToString();
                    _secret       = _dtuser.Rows[0]["secret"].ToString();

                    //boolean 3
                    _isdel   = Convert.ToBoolean(_dtuser.Rows[0]["isdel"]);
                    _iscx    = Convert.ToBoolean(_dtuser.Rows[0]["iscx"]);
                    _isfiled = Convert.ToBoolean(_dtuser.Rows[0]["isfiled"]);

                    //datetime 1
                    _make_date = Convert.ToDateTime(_dtuser.Rows[0]["make_date"]);
                    _true_date = Convert.ToDateTime(_dtuser.Rows[0]["truedate"]);
                }
            }
            else
            {
                throw new Exception("err on creat sig by id");
            }
        }
Beispiel #24
0
 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
     {
     }
 }
Beispiel #25
0
        protected void OK_Click(object sender, EventArgs e)
        {
            try
            {
                string            cmd_chk_date = "select top 1 * from m_state where m_dep_id =" + _uer.Udep_id + " order by m_s_id desc";
                publicClass.Dosql ds           = new publicClass.Dosql();
                ds.DoRe(cmd_chk_date);
                DateTime m_date = Convert.ToDateTime(ds.DtOut.Rows[0]["m_date"]);
                if (Convert.ToDateTime(make_date_txt.Text) <= m_date)
                {
                    publicClass.calljs.alert(this, "选择的填单日期已月结,请取消月结后在尝试填写票据!");
                    return;
                }

                publicClass.bill _bill = new publicClass.bill();
                _bill.Bill_id_head = "";
                _bill.Bill_id_body = 0;
                _bill.Bill_type    = 1;
                _bill.Payfrom      = _uer.Udep_id;
                _bill.Payto        = -1;
                _bill.Amount       = Convert.ToDecimal(this.Amount.Text);
                _bill.Summary      = Summary.Text;
                _bill.Maker        = _uer.Uid;
                _bill.Make_date    = Convert.ToDateTime(make_date_txt.Text);
                _bill.Isdel        = false;
                _bill.Iscx         = false;
                _bill.Prnt         = 0;
                _bill.Op           = 1;
                //_bill.Dep_id = _uer.Udep_id;
                _bill.Secret     = "";
                _bill.Payfrom_no = Convert.ToInt32(this.No.SelectedValue);
                _bill.Payto_no   = -1;
                _bill.Isfiled    = false;
                _bill.Truedate   = DateTime.Now;
                _bill.save();
                publicClass.calljs.alert(this, "保存成功");
                this.Amount.Text  = "";
                this.Summary.Text = "";
                Response.Redirect("review.aspx");
            }
            catch (Exception ex)
            {
                publicClass.calljs.alert(this, "填写项错误,单据保存失败!");
            }
        }
Beispiel #26
0
 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");
     }
 }
Beispiel #27
0
 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();
     }
 }
Beispiel #28
0
        public dep_no(int id)
        {
            string cmd = "select * from depno where 1=1 and no_id=" + id;

            publicClass.Dosql ds = new Dosql();
            ds.DoRe(cmd);
            if (ds.Sqled && ds.DtOut.Rows.Count >= 1)
            {
                _no      = ds.DtOut.Rows[0][2].ToString();
                _no_name = ds.DtOut.Rows[0][1].ToString();
                _summary = ds.DtOut.Rows[0][5].ToString();
                _status  = Convert.ToBoolean(ds.DtOut.Rows[0][3].ToString());
                _dep_id  = Convert.ToInt32(ds.DtOut.Rows[0][4].ToString());
            }
            else
            {
                throw new Exception("creat dep_no err!");
            }
        }
Beispiel #29
0
 protected void creat_siglist()
 {
     try
     {
         this.sigs.Items.Clear();
         this.sigs.Items.Add(new ListItem("请选择", "-1"));
         string            cmd_siglist = string.Format("select * from sig where state=1 and dep_id={0} and lvl={1}", _uer.Udep_id, _uer.Ulvl);
         publicClass.Dosql ds          = new publicClass.Dosql();
         ds.DoRe(cmd_siglist);
         foreach (DataRow r in ds.DtOut.Rows)
         {
             ListItem lt = new ListItem(r["sig_name"].ToString(), r["sig_id"].ToString());
             sigs.Items.Add(lt);
         }
     }
     catch
     {
     }
 }
Beispiel #30
0
        public Note(int id)
        {
            string cmd = "select * from note where 1=1 and uer_id=" + id;
            Dosql  ds  = new Dosql();

            ds.DoRe(cmd);
            if (ds.Sqled)
            {
                DataTable _dtuser = ds.DtOut;
                if (_dtuser.Rows.Count == 1)
                {
                    _note_id = Convert.ToInt32(_dtuser.Rows[0]["note_id"]);
                    _word    = _dtuser.Rows[0]["word"].ToString();
                }
            }
            else
            {
                throw new Exception("err on creat note by id");
            }
        }