protected void lbtn_save_Click(object sender, EventArgs e)
    {
        string wdh = weidaohuo.Text.Trim();

        if (wdh == "")
        {
            wdh = "0";
        }
        string cq = chaoqi.Text.Trim();

        if (cq == "")
        {
            cq = "0";
        }

        string sql    = "update tiaojian_info set chaoqi=" + cq + ",weidaohuo=" + wdh + "";
        int    result = DB.ExecuteSql(sql, null);

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh1(this, "保存成功", "tiaojian_info.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
Esempio n. 2
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        if (txtname.Text == "")
        {
            SystemTool.AlertShow(this, "管理员名称不能为空");
            return;
        }
        if (txtpassok.Text != txtpassok2.Text)
        {
            SystemTool.AlertShow(this, "两次输入密码不一致");
            return;
        }
        string sql    = "";
        int    result = 0;

        if (null != Request.QueryString["manId"])
        {
            //更新操作
            if (txtpassok.Text == "")
            {//密码不更新
                sql = "UPDATE manager_info set roleId='" + ddljiaose.SelectedValue + "',remark='" + SystemTool.NoHtml(txtbeizhu.Value) + "',state='" + ddlState.SelectedValue + "' where man_id=" + SystemTool.NoHtml(Request.QueryString["manId"]);
            }
            else
            {
                sql = "UPDATE manager_info set man_psw='" + SystemTool.jimi(SystemTool.NoHtml(txtpassok.Text)) + "',roleId='" + ddljiaose.SelectedValue + "',remark='" + SystemTool.NoHtml(txtbeizhu.Value) + "',state='" + ddlState.SelectedValue + "' where man_id=" + SystemTool.NoHtml(Request.QueryString["manId"]);
            }

            result = DB.ExecuteSql(sql, null);
        }
        else
        {
            sql = "select man_id from manager_info where man_name='" + SystemTool.NoHtml(txtname.Text) + "'";
            string r = DB.ExecuteSqlValue(sql, null);
            if (r != "" && r != "no")
            {
                SystemTool.AlertShow(this, "管理员名称已存在");
                return;
            }
            if (txtpassok.Text == "")
            {
                SystemTool.AlertShow(this, "管理员密码不能为空");
                return;
            }
            sql    = "insert into manager_info (man_name,man_psw,roleId,remark,state) values('" + SystemTool.NoHtml(txtname.Text) + "','" + SystemTool.jimi(SystemTool.NoHtml(txtpassok.Text)) + "'," + ddljiaose.SelectedValue + ",'" + SystemTool.NoHtml(txtbeizhu.Value) + "','" + ddlState.SelectedValue + "')";
            result = DB.ExecuteSql(sql, null);
        }

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh1(this, "保存成功", "guanliyuanlist.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }
Esempio n. 3
0
    //private void BindInfo()
    //{
    //    if (Request.QueryString["id"].ToString() != "")
    //    {
    //        string sql = "select * from taizhang_info where taizhang_id=" + Request.QueryString["id"];
    //        DataSet ds = DB.ExecuteSqlDataSet(sql, null);
    //        if (ds.Tables[0].Rows.Count > 0)
    //        {
    //            yuefen.Text = ds.Tables[0].Rows[0]["yuefen"].ToString();
    //            shiyongdanwei.Text = ds.Tables[0].Rows[0]["shiyongdanwei"].ToString();
    //            jihuabianhao.Text = ds.Tables[0].Rows[0]["jihuabianhao"].ToString();
    //            ddl_zijinlaiyuan.SelectedValue = ds.Tables[0].Rows[0]["zijinlaiyuan"].ToString();
    //            ddl_jihualeixing.SelectedValue = ds.Tables[0].Rows[0]["jihualeixing"].ToString();
    //            xunjiayuan.Text = ds.Tables[0].Rows[0]["xunjiayuan"].ToString();

    //            caigoubianhao.Text = ds.Tables[0].Rows[0]["caigoubianhao"].ToString();
    //            ddl_wuzishuxing.SelectedValue = ds.Tables[0].Rows[0]["wuzishuxing"].ToString();
    //            wuzibianma.Text = ds.Tables[0].Rows[0]["wuzibianma"].ToString();
    //            dingjiawuzimingcheng.Text = ds.Tables[0].Rows[0]["dingjiawuzimingcheng"].ToString();
    //            dingjiaguigexinghao.Text = ds.Tables[0].Rows[0]["dingjiaguigexinghao"].ToString();
    //            dingjiadanwei.Text = ds.Tables[0].Rows[0]["dingjiadanwei"].ToString();

    //            dingjiashuliang.Text = ds.Tables[0].Rows[0]["dingjiashuliang"].ToString();
    //            hanshuidanjia.Text = ds.Tables[0].Rows[0]["hanshuidanjia"].ToString();
    //            hanshuijine.Text = ds.Tables[0].Rows[0]["hanshuijine"].ToString();
    //            shuilv.Text = ds.Tables[0].Rows[0]["shuilv"].ToString();
    //            caigoufangshi.Text = ds.Tables[0].Rows[0]["caigoufangshi"].ToString();
    //            suoshuxieyihao.Text = ds.Tables[0].Rows[0]["suoshuxieyihao"].ToString();

    //            dingdanbianhao.Text = ds.Tables[0].Rows[0]["dingdanbianhao"].ToString();
    //            dinghuoyiju.Text = ds.Tables[0].Rows[0]["dinghuoyiju"].ToString();
    //            //jiaohuoshijian.Text = ds.Tables[0].Rows[0]["jiaohuoqi"].ToString();
    //            ddl_jiaohuodidian.SelectedValue = ds.Tables[0].Rows[0]["jiaohuodidian"].ToString();
    //            zhizaoshang.Text = ds.Tables[0].Rows[0]["zhizaoshang"].ToString();
    //            wuzipinpai.Text = ds.Tables[0].Rows[0]["wuzipinpai"].ToString();
    //            gonghuochangshang.Text = ds.Tables[0].Rows[0]["gonghuochangshang"].ToString();

    //            ddl_dianshangpingtai.SelectedValue = ds.Tables[0].Rows[0]["dianshangpingtai"].ToString();
    //            wangdianmingcheng.Text = ds.Tables[0].Rows[0]["wangdianmingcheng"].ToString();
    //            ddl_fukuanfangshi.SelectedValue = ds.Tables[0].Rows[0]["fukuanfangshi"].ToString();
    //            changshangdianhua.Text = ds.Tables[0].Rows[0]["changshangdianhua"].ToString();
    //            dingdanriqi.Text = ds.Tables[0].Rows[0]["dingdanriqi"].ToString();
    //            jiaohuoqi.Text = ds.Tables[0].Rows[0]["jiaohuoqi"].ToString();

    //            yingdaoshijian.Text = ds.Tables[0].Rows[0]["yingdaoshijian"].ToString();
    //            shidaoshijian.Text = ds.Tables[0].Rows[0]["shidaoshijian"].ToString();
    //            shiyongshouming.Text = ds.Tables[0].Rows[0]["shiyongshouming"].ToString();
    //            zhibaoqi.Text = ds.Tables[0].Rows[0]["zhibaoqi"].ToString();
    //            qita.Text = ds.Tables[0].Rows[0]["qita"].ToString();
    //            beizhu.Value = ds.Tables[0].Rows[0]["beizhu"].ToString();
    //            ddl_state.SelectedValue = ds.Tables[0].Rows[0]["isfinished"].ToString();
    //            if (ds.Tables[0].Rows[0]["isfinished"].ToString() == "1")
    //            {
    //                ddl_state.Enabled = false;
    //            }
    //        }
    //        sql = "select man_name from manager_info where man_id=" + ViewState["user_id"];
    //        string resulta = DB.ExecuteSqlValue(sql, null);
    //        if (resulta != "" && resulta != "no")
    //        {
    //            lbl_user.Text = resulta;
    //        }
    //    }
    //}
    protected void lbtn_save_Click(object sender, EventArgs e)
    {
        string daohuoshuliang = txtdaohuoshuliang.Text;

        if (daohuoshuliang == "")
        {
            daohuoshuliang = "0";
        }
        string taizhangid = "0";

        if (null != Request.QueryString["id"])
        {
            taizhangid = Request.QueryString["id"].ToString();
        }
        string manid = ViewState["user_id"].ToString();
        string bz    = beizhu.Value;

        SqlParameter[] pars = new SqlParameter[] {
            new SqlParameter("@daohuoshuliang", System.Data.SqlDbType.NVarChar)
            {
                Value = daohuoshuliang
            },
            new SqlParameter("@taizhangid", System.Data.SqlDbType.NVarChar)
            {
                Value = taizhangid
            },
            new SqlParameter("@manid", System.Data.SqlDbType.NVarChar)
            {
                Value = manid
            },
            new SqlParameter("@bz", System.Data.SqlDbType.NVarChar)
            {
                Value = bz
            }
        };

        if (null != Request.QueryString["id"])
        {
            string sqlck    = "select taizhang_id from taizhang_info where taizhang_id='" + Request.QueryString["id"] + "' and manager_id=" + ViewState["user_id"];
            string resultck = DB.ExecuteSqlValue(sqlck, null);
            if (resultck == "" || resultck == "no")
            {
                SystemTool.AlertShow(this, "非添加者,不可操作此记录");
                return;
            }
            string sql = "insert into jilu_info (daohuo,taizhang_id,manager_id,beizhu) values(@daohuoshuliang,@taizhangid,@manid,@bz)";
            //string sql = "update taizhang_info set yuefen=@yuefen,shiyongdanwei=@shiyongdanwei,jihuabianhao=@jihuabianhao,zijinlaiyuan=@zijinlaiyuan,jihualeixing=@jihualeixing,xunjiayuan=@xunjiayuan,caigoubianhao=@caigoubianhao,wuzishuxing=@wuzishuxing,wuzibianma=@wuzibianma,dingjiawuzimingcheng=@dingjiawuzimingcheng,dingjiaguigexinghao=@dingjiaguigexinghao,dingjiadanwei=@dingjiadanwei,dingjiashuliang=@dingjiashuliang,hanshuidanjia=@hanshuidanjia,hanshuijine=@hanshuijine,shuilv=@shuilv,caigoufangshi=@caigoufangshi,suoshuxieyihao=@suoshuxieyihao,dingdanbianhao=@dingdanbianhao,dinghuoyiju=@dinghuoyiju,jiaohuodidian=@jiaohuodidian,zhizaoshang=@zhizaoshang,wuzipinpai=@wuzipinpai,gonghuochangshang=@gonghuochangshang,dianshangpingtai=@dianshangpingtai,wangdianmingcheng=@wangdianmingcheng,fukuanfangshi=@fukuanfangshi,changshangdianhua=@changshangdianhua,dingdanriqi=@dingdanriqi,jiaohuoqi=@jiaohuoqi,yingdaoshijian=@yingdaoshijian,shidaoshijian=@shidaoshijian,shiyongshouming=@shiyongshouming,zhibaoqi=@zhibaoqi,qita=@qita,beizhu=@beizhu,isfinished=@isfinished where taizhang_id=" + Request.QueryString["id"];
            int result = DB.ExecuteSql(sql, pars);
            if (result > 0)
            {
                SystemTool.AlertShow_Refresh1(this, "保存成功", "taizhang_list.aspx");
            }
            else
            {
                SystemTool.AlertShow(this, "保存失败");
                return;
            }
        }
        //else
        //{
        //    string sql = "insert into taizhang_info( yuefen,shiyongdanwei,jihuabianhao,zijinlaiyuan,jihualeixing,xunjiayuan,caigoubianhao,wuzishuxing,wuzibianma,dingjiawuzimingcheng,dingjiaguigexinghao,dingjiadanwei,dingjiashuliang,hanshuidanjia,hanshuijine,shuilv,caigoufangshi,suoshuxieyihao,dingdanbianhao,dinghuoyiju,jiaohuodidian,zhizaoshang,wuzipinpai,gonghuochangshang,dianshangpingtai,wangdianmingcheng,fukuanfangshi,changshangdianhua,dingdanriqi,jiaohuoqi,yingdaoshijian,shidaoshijian,shiyongshouming,zhibaoqi,qita,beizhu) values (@yuefen,@shiyongdanwei,@jihuabianhao,@zijinlaiyuan,@jihualeixing,@xunjiayuan,@caigoubianhao,@wuzishuxing,@wuzibianma,@dingjiawuzimingcheng,@dingjiaguigexinghao,@dingjiadanwei,@dingjiashuliang,@hanshuidanjia,@hanshuijine,@shuilv,@caigoufangshi,@suoshuxieyihao,@dingdanbianhao,@dinghuoyiju,@jiaohuodidian,@zhizaoshang,@wuzipinpai,@gonghuochangshang,@dianshangpingtai,@wangdianmingcheng,@fukuanfangshi,@changshangdianhua,@dingdanriqi,@jiaohuoqi,@yingdaoshijian,@shidaoshijian,@shiyongshouming,@zhibaoqi,@qita,@beizhu)";
        //    int result = DB.ExecuteSql(sql, pars);
        //    if (result > 0)
        //    {
        //        SystemTool.AlertShow_Refresh1(this, "保存成功", "taizhang_list.aspx");
        //    }
        //    else
        //    {
        //        SystemTool.AlertShow(this, "保存失败");
        //        return;
        //    }
        //}
    }
    protected void lbtn_save_Click(object sender, EventArgs e)
    {
        string suoshucequ = ddl_AreaInfo.SelectedValue;

        if (suoshucequ == "0")
        {
            SystemTool.AlertShow(this, "所属测区不能为空");
            return;
        }
        string mianxiangxinxi = ddl_WorkfaceInfo.SelectedValue;

        if (mianxiangxinxi == "0")
        {
            SystemTool.AlertShow(this, "面巷信息不能为空");
            return;
        }
        string fenzhanhao = ddl_fenzhanhao.SelectedValue;

        if (fenzhanhao == "0")
        {
            SystemTool.AlertShow(this, "分站号不能为空");
            return;
        }
        string duankouhao = ddl_duankouhao.SelectedValue;

        if (duankouhao == "0")
        {
            SystemTool.AlertShow(this, "端口号不能为空");
            return;
        }
        string botelv = ddl_botelv.SelectedValue;

        if (botelv == "0")
        {
            SystemTool.AlertShow(this, "波特率不能为空");
            return;
        }
        string shiyongzhuangtai = ddl_shiyongzhuangtai.SelectedValue;

        if (shiyongzhuangtai == "0")
        {
            SystemTool.AlertShow(this, "使用状态不能为空");
            return;
        }

        if (null != Request.QueryString["id"])
        {
            string  sqlck = "select * from commport  where areaname='" + suoshucequ + "' and areaface='" + mianxiangxinxi + "' and stationno=" + Request.QueryString["id"];
            DataSet dsck  = DB.ExecuteSqlDataSet(sqlck, null);
            if (dsck.Tables[0].Rows.Count <= 0)
            {
                SystemTool.AlertShow(this, "该分站号不存在");
                return;
            }
            string sql    = "update commport set stationno='" + fenzhanhao + "',commno='" + duankouhao + "',baudrate='" + botelv + "',usestate='" + shiyongzhuangtai + "'  where areaname='" + suoshucequ + "' and areaface='" + mianxiangxinxi + "' and stationno=" + Request.QueryString["id"];
            int    result = DB.ExecuteSql(sql, null);
            if (result > 0)
            {
                SystemTool.AlertShow_Refresh1(this, "保存成功", "fenzhanjiduankoushezhi.aspx");
            }
            else
            {
                SystemTool.AlertShow(this, "保存失败");
                return;
            }
        }
        else
        {
            string sqlck = "select stationno from commport where stationno='" + fenzhanhao + "'";
            string re    = DB.ExecuteSqlValue(sqlck, null);
            if (re != "" && re != "no")
            {
                SystemTool.AlertShow(this, "该分站号已存在");
                return;
            }
            string sql = "insert into commport (areaname,areaface,stationno,commno,baudrate,usestate) values";
            sql += "('" + suoshucequ + "','" + mianxiangxinxi + "','" + fenzhanhao + "','" + duankouhao + "','" + botelv + "','" + shiyongzhuangtai + "')";
            int result = DB.ExecuteSql(sql, null);
            if (result > 0)
            {
                SystemTool.AlertShow_Refresh1(this, "保存成功", "fenzhanjiduankoushezhi.aspx");
            }
            else
            {
                SystemTool.AlertShow(this, "保存失败");
                return;
            }
        }
    }
    protected void lbtn_save_Click(object sender, EventArgs e)
    {
        string yuefena               = yuefen.Text;                    // = ds.Tables[0].Rows[0]["yuefen"].ToString();
        string shiyongdanweia        = shiyongdanwei.Text;             // = ds.Tables[0].Rows[0]["shiyongdanwei"].ToString();
        string jihuabianhaoa         = jihuabianhao.Text;              // = ds.Tables[0].Rows[0]["jihuabianhao"].ToString();
        string zijinlaiyuana         = ddl_zijinlaiyuan.SelectedValue; // = ds.Tables[0].Rows[0]["zijinlaiyuan"].ToString();
        string jihualeixinga         = ddl_jihualeixing.SelectedValue; // = ds.Tables[0].Rows[0]["jihualeixing"].ToString();
        string xunjiayuana           = xunjiayuan.Text;                // = ds.Tables[0].Rows[0]["xunjiayuan"].ToString();
        string caigoubianhaoa        = caigoubianhao.Text;             // = ds.Tables[0].Rows[0]["caigoubianhao"].ToString();
        string wuzishuxinga          = ddl_wuzishuxing.SelectedValue;  // = ds.Tables[0].Rows[0]["wuzishuxing"].ToString();
        string wuzibianmaa           = wuzibianma.Text;                // = ds.Tables[0].Rows[0]["wuzibianma"].ToString();
        string dingjiawuzimingchenga = dingjiawuzimingcheng.Text;      // = ds.Tables[0].Rows[0]["dingjiawuzimingcheng"].ToString();
        string dingjiaguigexinghaoa  = dingjiaguigexinghao.Text;       // = ds.Tables[0].Rows[0]["dingjiaguigexinghao"].ToString();
        string dingjiadanweia        = dingjiadanwei.Text;             // = ds.Tables[0].Rows[0]["dingjiadanwei"].ToString();
        string dingjiashulianga      = dingjiashuliang.Text;           // = ds.Tables[0].Rows[0]["dingjiashuliang"].ToString();

        if (dingjiashulianga == "")
        {
            dingjiashulianga = "0";
        }
        string hanshuidanjiaa = hanshuidanjia.Text;// = ds.Tables[0].Rows[0]["hanshuidanjia"].ToString();

        if (hanshuidanjiaa == "")
        {
            hanshuidanjiaa = "0";
        }
        string hanshuijinea = hanshuijine.Text;// = ds.Tables[0].Rows[0]["hanshuijine"].ToString();

        if (hanshuijinea == "")
        {
            hanshuijinea = "0";
        }
        string shuilva = shuilv.Text;// = ds.Tables[0].Rows[0]["shuilv"].ToString();

        if (shuilva == "")
        {
            shuilva = "0";
        }
        string caigoufangshia  = caigoufangshi.Text;                    // = ds.Tables[0].Rows[0]["caigoufangshi"].ToString();
        string suoshuxieyihaoa = suoshuxieyihao.Text;                   //= ds.Tables[0].Rows[0]["suoshuxieyihao"].ToString();
        string dingdanbianhaoa = dingdanbianhao.Text;                   // = ds.Tables[0].Rows[0]["dingdanbianhao"].ToString();
        string dinghuoyijua    = dinghuoyiju.Text;                      // = ds.Tables[0].Rows[0]["dinghuoyiju"].ToString();
        //string jiaohuoshijiana=jiaohuoshijian.Text;// = ds.Tables[0].Rows[0]["jiaohuoshijian"].ToString();
        string jiaohuodidiana     = ddl_jiaohuodidian.SelectedValue;    // = ds.Tables[0].Rows[0]["jiaohuodidian"].ToString();
        string zhizaoshanga       = zhizaoshang.Text;
        string wuzipinpaia        = wuzipinpai.Text;                    // = ds.Tables[0].Rows[0]["wuzipinpai"].ToString();
        string gonghuochangshanga = gonghuochangshang.Text;             // = ds.Tables[0].Rows[0]["gonghuochangshang"].ToString();
        string dianshangpingtaia  = ddl_dianshangpingtai.SelectedValue; // = ds.Tables[0].Rows[0]["dianshangpingtai"].ToString();
        string wangdianmingchenga = wangdianmingcheng.Text;             // = ds.Tables[0].Rows[0]["wangdianmingcheng"].ToString();
        string fukuanfangshia     = ddl_fukuanfangshi.SelectedValue;    // = ds.Tables[0].Rows[0]["fukuanfangshi"].ToString();
        string changshangdianhuaa = changshangdianhua.Text;             // = ds.Tables[0].Rows[0]["changshangdianhua"].ToString();
        string dingdanriqia       = dingdanriqi.Text;                   // = ds.Tables[0].Rows[0]["dingdanriqi"].ToString();
        string jiaohuoqia         = jiaohuoqi.Text;                     // = ds.Tables[0].Rows[0]["jiaohuoqi"].ToString();
        string yingdaoshijiana    = yingdaoshijian.Text;                // = ds.Tables[0].Rows[0]["yingdaoshijian"].ToString();
        string shidaoshijiana     = shidaoshijian.Text;                 // = ds.Tables[0].Rows[0]["shidaoshijian"].ToString();
        string shiyongshouminga   = shiyongshouming.Text;               // = ds.Tables[0].Rows[0]["shiyongshouming"].ToString();
        string zhibaoqia          = zhibaoqi.Text;                      // = ds.Tables[0].Rows[0]["zhibaoqi"].ToString();
        string qitaa   = qita.Text;                                     // = ds.Tables[0].Rows[0]["qita"].ToString();
        string beizhua = beizhu.Value;                                  // = ds.Tables[0].Rows[0]["beizhu"].ToString();
        string state   = ddl_state.SelectedValue;

        if (state == "0")
        {
            shidaoshijiana = "";
        }
        SqlParameter[] pars = new SqlParameter[] {
            new SqlParameter("@yuefen", System.Data.SqlDbType.NVarChar)
            {
                Value = yuefena
            },
            new SqlParameter("@shiyongdanwei", System.Data.SqlDbType.NVarChar)
            {
                Value = shiyongdanweia
            },
            new SqlParameter("@jihuabianhao", System.Data.SqlDbType.NVarChar)
            {
                Value = jihuabianhaoa
            },
            new SqlParameter("@zijinlaiyuan", System.Data.SqlDbType.NVarChar)
            {
                Value = zijinlaiyuana
            },
            new SqlParameter("@jihualeixing", System.Data.SqlDbType.NVarChar)
            {
                Value = jihualeixinga
            },
            new SqlParameter("@xunjiayuan", System.Data.SqlDbType.NVarChar)
            {
                Value = xunjiayuana
            },
            new SqlParameter("@caigoubianhao", System.Data.SqlDbType.NVarChar)
            {
                Value = caigoubianhaoa
            },
            new SqlParameter("@wuzishuxing", System.Data.SqlDbType.NVarChar)
            {
                Value = wuzishuxinga
            },
            new SqlParameter("@wuzibianma", System.Data.SqlDbType.NVarChar)
            {
                Value = wuzibianmaa
            },
            new SqlParameter("@dingjiawuzimingcheng", System.Data.SqlDbType.NVarChar)
            {
                Value = dingjiawuzimingchenga
            },
            new SqlParameter("@dingjiaguigexinghao", System.Data.SqlDbType.NVarChar)
            {
                Value = dingjiaguigexinghaoa
            },
            new SqlParameter("@dingjiadanwei", System.Data.SqlDbType.NVarChar)
            {
                Value = dingjiadanweia
            },
            new SqlParameter("@dingjiashuliang", System.Data.SqlDbType.Decimal)
            {
                Value = dingjiashulianga
            },
            new SqlParameter("@hanshuidanjia", System.Data.SqlDbType.Decimal)
            {
                Value = hanshuidanjiaa
            },
            new SqlParameter("@hanshuijine", System.Data.SqlDbType.Decimal)
            {
                Value = hanshuijinea
            },
            new SqlParameter("@shuilv", System.Data.SqlDbType.Decimal)
            {
                Value = shuilva
            },
            new SqlParameter("@caigoufangshi", System.Data.SqlDbType.NVarChar)
            {
                Value = caigoufangshia
            },
            new SqlParameter("@suoshuxieyihao", System.Data.SqlDbType.NVarChar)
            {
                Value = suoshuxieyihaoa
            },
            new SqlParameter("@dingdanbianhao", System.Data.SqlDbType.NVarChar)
            {
                Value = dingdanbianhaoa
            },
            new SqlParameter("@dinghuoyiju", System.Data.SqlDbType.NVarChar)
            {
                Value = dinghuoyijua
            },
            new SqlParameter("@jiaohuodidian", System.Data.SqlDbType.NVarChar)
            {
                Value = jiaohuodidiana
            },
            new SqlParameter("@zhizaoshang", System.Data.SqlDbType.NVarChar)
            {
                Value = zhizaoshanga
            },
            new SqlParameter("@wuzipinpai", System.Data.SqlDbType.NVarChar)
            {
                Value = wuzipinpaia
            },
            new SqlParameter("@gonghuochangshang", System.Data.SqlDbType.NVarChar)
            {
                Value = gonghuochangshanga
            },
            new SqlParameter("@dianshangpingtai", System.Data.SqlDbType.NVarChar)
            {
                Value = dianshangpingtaia
            },
            new SqlParameter("@wangdianmingcheng", System.Data.SqlDbType.NVarChar)
            {
                Value = wangdianmingchenga
            },
            new SqlParameter("@fukuanfangshi", System.Data.SqlDbType.NVarChar)
            {
                Value = fukuanfangshia
            },
            new SqlParameter("@changshangdianhua", System.Data.SqlDbType.NVarChar)
            {
                Value = changshangdianhuaa
            },
            new SqlParameter("@dingdanriqi", System.Data.SqlDbType.NVarChar)
            {
                Value = dingdanriqia
            },
            new SqlParameter("@jiaohuoqi", System.Data.SqlDbType.NVarChar)
            {
                Value = jiaohuoqia
            },
            new SqlParameter("@yingdaoshijian", System.Data.SqlDbType.NVarChar)
            {
                Value = yingdaoshijiana
            },
            new SqlParameter("@shidaoshijian", System.Data.SqlDbType.NVarChar)
            {
                Value = shidaoshijiana
            },
            new SqlParameter("@shiyongshouming", System.Data.SqlDbType.NVarChar)
            {
                Value = shiyongshouminga
            },
            new SqlParameter("@zhibaoqi", System.Data.SqlDbType.NVarChar)
            {
                Value = zhibaoqia
            },
            new SqlParameter("@qita", System.Data.SqlDbType.NVarChar)
            {
                Value = qitaa
            },
            new SqlParameter("@beizhu", System.Data.SqlDbType.NVarChar)
            {
                Value = beizhua
            },
            new SqlParameter("@isfinished", System.Data.SqlDbType.Int)
            {
                Value = state
            }
        };

        if (null != Request.QueryString["id"])
        {
            string sqlck    = "select taizhang_id from taizhang_info where taizhang_id='" + Request.QueryString["id"] + "' and manager_id=" + ViewState["user_id"];
            string resultck = DB.ExecuteSqlValue(sqlck, null);
            if (resultck == "" || resultck == "no")
            {
                SystemTool.AlertShow(this, "非添加者,不可操作此记录");
                return;
            }
            string sql    = "update taizhang_info set yuefen=@yuefen,shiyongdanwei=@shiyongdanwei,jihuabianhao=@jihuabianhao,zijinlaiyuan=@zijinlaiyuan,jihualeixing=@jihualeixing,xunjiayuan=@xunjiayuan,caigoubianhao=@caigoubianhao,wuzishuxing=@wuzishuxing,wuzibianma=@wuzibianma,dingjiawuzimingcheng=@dingjiawuzimingcheng,dingjiaguigexinghao=@dingjiaguigexinghao,dingjiadanwei=@dingjiadanwei,dingjiashuliang=@dingjiashuliang,hanshuidanjia=@hanshuidanjia,hanshuijine=@hanshuijine,shuilv=@shuilv,caigoufangshi=@caigoufangshi,suoshuxieyihao=@suoshuxieyihao,dingdanbianhao=@dingdanbianhao,dinghuoyiju=@dinghuoyiju,jiaohuodidian=@jiaohuodidian,zhizaoshang=@zhizaoshang,wuzipinpai=@wuzipinpai,gonghuochangshang=@gonghuochangshang,dianshangpingtai=@dianshangpingtai,wangdianmingcheng=@wangdianmingcheng,fukuanfangshi=@fukuanfangshi,changshangdianhua=@changshangdianhua,dingdanriqi=@dingdanriqi,jiaohuoqi=@jiaohuoqi,yingdaoshijian=@yingdaoshijian,shidaoshijian=@shidaoshijian,shiyongshouming=@shiyongshouming,zhibaoqi=@zhibaoqi,qita=@qita,beizhu=@beizhu,isfinished=@isfinished where taizhang_id=" + Request.QueryString["id"];
            int    result = DB.ExecuteSql(sql, pars);
            if (result > 0)
            {
                SystemTool.AlertShow_Refresh1(this, "保存成功", "taizhang_list.aspx");
            }
            else
            {
                SystemTool.AlertShow(this, "保存失败");
                return;
            }
        }
        else
        {
            string sql    = "insert into taizhang_info( yuefen,shiyongdanwei,jihuabianhao,zijinlaiyuan,jihualeixing,xunjiayuan,caigoubianhao,wuzishuxing,wuzibianma,dingjiawuzimingcheng,dingjiaguigexinghao,dingjiadanwei,dingjiashuliang,hanshuidanjia,hanshuijine,shuilv,caigoufangshi,suoshuxieyihao,dingdanbianhao,dinghuoyiju,jiaohuodidian,zhizaoshang,wuzipinpai,gonghuochangshang,dianshangpingtai,wangdianmingcheng,fukuanfangshi,changshangdianhua,dingdanriqi,jiaohuoqi,yingdaoshijian,shidaoshijian,shiyongshouming,zhibaoqi,qita,beizhu) values (@yuefen,@shiyongdanwei,@jihuabianhao,@zijinlaiyuan,@jihualeixing,@xunjiayuan,@caigoubianhao,@wuzishuxing,@wuzibianma,@dingjiawuzimingcheng,@dingjiaguigexinghao,@dingjiadanwei,@dingjiashuliang,@hanshuidanjia,@hanshuijine,@shuilv,@caigoufangshi,@suoshuxieyihao,@dingdanbianhao,@dinghuoyiju,@jiaohuodidian,@zhizaoshang,@wuzipinpai,@gonghuochangshang,@dianshangpingtai,@wangdianmingcheng,@fukuanfangshi,@changshangdianhua,@dingdanriqi,@jiaohuoqi,@yingdaoshijian,@shidaoshijian,@shiyongshouming,@zhibaoqi,@qita,@beizhu)";
            int    result = DB.ExecuteSql(sql, pars);
            if (result > 0)
            {
                SystemTool.AlertShow_Refresh1(this, "保存成功", "taizhang_list.aspx");
            }
            else
            {
                SystemTool.AlertShow(this, "保存失败");
                return;
            }
        }
    }
Esempio n. 6
0
    protected void btnok_Click(object sender, EventArgs e)
    {
        if (txtname.Text == "")
        {
            SystemTool.AlertShow(this, "组名称不能为空");
            return;
        }
        //string diqu_ids = "";
        //for (int i = 0; i < rpt_sheng.Items.Count; i++)
        //{
        //    CheckBox ckb = rpt_sheng.Items[i].FindControl("ckb") as CheckBox;
        //    if (ckb.Checked == true)
        //    {
        //        diqu_ids += ckb.ToolTip + ",";
        //    }
        //    Repeater rpta = rpt_sheng.Items[i].FindControl("rpta_sheng") as Repeater;
        //    for (int j = 0; j < rpta.Items.Count; j++)
        //    {
        //        CheckBox ckba = rpta.Items[j].FindControl("ckba") as CheckBox;
        //        if (ckba.Checked == true)
        //        {
        //            diqu_ids += ckba.ToolTip + ",";
        //        }
        //    }
        //}
        //if (diqu_ids.Length > 0)
        //{
        //    diqu_ids = diqu_ids.Substring(0, diqu_ids.Length - 1);
        //}
        //else
        //{
        //    SystemTool.AlertShow(this, "请选择地区");
        //    return;
        //}
        string moduleIds = "";

        for (int i = 0; i < rpt.Items.Count; i++)
        {
            CheckBox ckb = rpt.Items[i].FindControl("ckb") as CheckBox;
            if (ckb.Checked == true)
            {
                moduleIds += ckb.ToolTip + ",";
            }
            Repeater rpta = rpt.Items[i].FindControl("rpta") as Repeater;
            for (int j = 0; j < rpta.Items.Count; j++)
            {
                CheckBox ckba = rpta.Items[j].FindControl("ckba") as CheckBox;
                if (ckba.Checked == true)
                {
                    moduleIds += ckba.ToolTip + ",";
                }
            }
        }
        if (moduleIds.Length > 0)
        {
            moduleIds = moduleIds.Substring(0, moduleIds.Length - 1);
        }
        else
        {
            SystemTool.AlertShow(this, "请选择组权限");
            return;
        }
        string sql    = "";
        int    result = 0;

        if (null != Request.QueryString["manId"])
        {
            //更新操作
            sql    = "update role_info set roleName='" + SystemTool.NoHtml(txtname.Text) + "',moduleId='" + moduleIds + "',remark='" + SystemTool.NoHtml(txtbeizhu.Value) + "',state='" + ddlState.SelectedValue + "',quanxianzhi=" + SystemTool.NoHtml(txtpassok.Text) + ",paixu=" + SystemTool.NoHtml(paixu.Text) + ",diqu_ids='' where id=" + SystemTool.NoHtml(Request.QueryString["manId"]);
            result = DB.ExecuteSql(sql, null);
        }
        else
        {
            sql = "select id from role_info where roleName='" + SystemTool.NoHtml(txtname.Text) + "'";
            string r = DB.ExecuteSqlValue(sql, null);
            if (r != "" && r != "no")
            {
                SystemTool.AlertShow(this, "组名称已存在");
                return;
            }
            sql    = "insert into role_info (roleName,moduleId,remark,state,quanxianzhi,paixu,diqu_ids) values('" + SystemTool.NoHtml(txtname.Text) + "','" + moduleIds + "','" + SystemTool.NoHtml(txtbeizhu.Value) + "','" + ddlState.SelectedValue + "'," + SystemTool.NoHtml(txtpassok.Text) + "," + SystemTool.NoHtml(paixu.Text) + ",'')";
            result = DB.ExecuteSql(sql, null);
        }

        if (result > 0)
        {
            SystemTool.AlertShow_Refresh1(this, "保存成功", "guanliyuanzulist.aspx");
        }
        else
        {
            SystemTool.AlertShow(this, "保存失败");
            return;
        }
    }