Exemplo n.º 1
0
    protected void btn_bk_Click(object sender, EventArgs e)
    {
        string str_sql           = "";
        string str_condition_yes = "";
        string str_condition_no  = "";

        for (int i = 0; i < cbxlist_bk.Items.Count; i++)
        {
            if (cbxlist_bk.Items[i].Selected)
            {
                str_condition_yes = str_condition_yes + "," + cbxlist_bk.Items[i].Text;
            }
            else
            {
                str_condition_no = str_condition_no + "," + cbxlist_bk.Items[i].Text;
            }
        }
        str_sql = "update lqsf set 录取完毕 = '是' where 本专科='本科' and instr( '" + str_condition_yes + "',地区)>0 ";
        string str_sql1 = "update lqsf set 录取完毕 = '否' where 本专科='本科' and instr('" + str_condition_no + "',地区)>0";

        if (str_condition_yes == "")
        {
            if (DBFun.ExecuteUpdate(str_sql1))
            {
                Response.Write(@"<script>alert('保存成功!');</script>");
            }
            else
            {
                Response.Write(@"<script>alert('保存失败!');</script>");
            }
        }
        else if (str_condition_no == "")
        {
            if (DBFun.ExecuteUpdate(str_sql))
            {
                Response.Write(@"<script>alert('保存成功!');</script>");
            }
            else
            {
                Response.Write(@"<script>alert('保存失败!');</script>");
            }
        }
        else
        {
            if (DBFun.ExecuteUpdate(str_sql) && DBFun.ExecuteUpdate(str_sql1))
            {
                Response.Write(@"<script>alert('保存成功!');</script>");
            }
            else
            {
                Response.Write(@"<script>alert('保存失败!');</script>");
            }
        }
    }
Exemplo n.º 2
0
        private void DeleteFromDb(string ID)
        {
            //删除一个记录
            string strsql = string.Format("Delete From T_class where id={0}", ID);

            if (DBFun.ExecuteUpdate(strsql))
            {
                Response.Write("<script>alert('删除成功!');");
                Response.Redirect(Request.UrlReferrer.ToString());
            }
        }
Exemplo n.º 3
0
    protected void gv_detail_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        DataView dv      = (DataView)Session["dv_detail"];
        string   str_sql = "delete from download where id = " + dv.Table.Rows[e.RowIndex + gv_detail.PageIndex * gv_detail.PageSize]["id"].ToString();

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('删除成功!');</script>");
            bindData();
        }
    }
Exemplo n.º 4
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        DataView dv      = (DataView)Session["dv_detail"];
        string   str_sql = "delete from t_pszj where appyear = year(date()) and sfzh = '" + dv.Table.Rows[e.RowIndex + GridView1.PageIndex * GridView1.PageSize]["sfzh"].ToString() + "'";

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('删除成功!');</script>");
            bindData();
        }
    }
Exemplo n.º 5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //添加
            //保存图片



            string strsql;
            string NewID   = "";
            string img_url = UploadPicFile(FileUpload1);

            if (img_url == "")
            {
                img_url = "nopic.jpg";  //不上传图片,默认为无图片
            }
            strsql = string.Format("insert Into T_films (PathID,Film_name,Other_name,Film_director,Film_Player,"
                                   + "Film_class,Film_classID,Film_from,film_Level,film_clear,film_money,film_Pic,film_gut,"
                                   + "playtype,filmisseq,Filmisgood1,"
                                   + "filmisGood2,FilePhyPath,FileFolder,AllowDown,ShowType,SearchKey) values ({0},'{1}','{2}','{3}','{4}',"
                                   + "'{5}',{6},{7},{8},{9},{10},'{11}','{12}',"
                                   + "{13},{14},{15},"
                                   + "{16},'{17}','{18}',{19},{20},'{21}')",
                                   DwPath.SelectedValue, TbFilmname.Text, TbOthername.Text, TbDirector.Text, TbPlayer.Text,
                                   DwClass.SelectedItem.Text, DwClass.SelectedItem.Value, DwFrom.SelectedItem.Value,
                                   DwLevel.Text, DwClear.Text, (TbMoney.Text == "" ? "0" : TbMoney.Text), img_url, TbGut.Text.Replace("'", "''"),
                                   Rbfilmtype.Text, RbIsReq.Text, (CkbBest.Items[0].Selected ? 1 : 0), (CkbBest.Items[1].Selected ? 1 : 0),
                                   TbFilmPhyPath.Text, uppath.Value, Rb_AllowDown.Text, Rb_Showtype.Text,
                                   (Tb_SearchKey.Text == "" ? TbFilmname.Text : Tb_SearchKey.Text));
            try
            {
                if (DBFun.ExecuteUpdate(strsql))
                {
                    NewID = DBFun.SearchValue("select Max(ID) from T_films");

                    int ijs = 0;
                    for (int i = 1; i <= Convert.ToInt32(upjs.Value); i++)
                    {
                        strsql = string.Format("Insert Into [T_film_detail] (filename,filmid) values ('{0}',{1})",
                                               Request["urla" + i], NewID);
                        if (DBFun.ExecuteUpdate(strsql))
                        {
                            ijs++;
                        }
                    }
                    strsql = string.Format("update T_films Set film_num = {0} where id={1}", ijs, NewID);
                    DBFun.ExecuteSql(strsql);
                    Response.Write("<script>alert('影片添加成功!');window.location.href='film_edit.aspx?Action=Edit&ID=" + NewID + "';</script>");
                }
            }
            catch
            {
                Response.Write("<script>alert('影片添加失败!请确认填写正确!');</script>");
            }
        }
Exemplo n.º 6
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        str_sql = ViewState["sql"].ToString();
        dv      = DBFun.GetDataView(str_sql);
        str_sql = "delete from t_ExpertList3 where appyear=year(date()) and LoginName = '" + dv.Table.Rows[e.RowIndex + (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize]["LoginName"].ToString() + "'";

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('移除成功!');</script>");
            bindData();
        }
    }
Exemplo n.º 7
0
    protected void btn_confirm_Click(object sender, EventArgs e)
    {
        string str_pwd = tbx_pwd_new.Text.Trim();

        //tbx_sfzh.Text = tbx_admin_name.Text;

        if (lbl_editflag.Text == "insert")
        {
            //if (tbx_sfzh.Text.Length == 18)
            //{
            //    str_pwd = tbx_sfzh.Text.Substring(8, 6);
            //}
            //else
            //{
            //    str_pwd = tbx_sfzh.Text.Substring(6, 6);
            //}

            str_pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str_pwd, "MD5");
            str_sql = "select count(*) from t_yszj where appyear=year(date()) and sfzh = '" + tbx_sfzh.Text.Trim() + "'";
            if (DBFun.ExecuteScalar(str_sql).ToString() == "1")
            {
                Response.Write("<script>alert('该登录名已存在,请重新输入登录名!');</script>");
                return;
            }
            str_sql = string.Format("Insert Into t_yszj (zjdm,Username,sfzh,pwd,xingbie,gzdw,zc,phone,appyear) select '{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}',url from t_dict where flm=8 and bm=6",
                                    tbx_admin_name.Text.Trim(), tbx_user_name.Text.Trim(), tbx_sfzh.Text, str_pwd, rbtnlist_xb.SelectedValue, tbx_gzdw.Text, tbx_zc.Text, "");
        }
        else
        {
            if (str_pwd == null || str_pwd == "")
            {
                str_sql = string.Format("update t_yszj set loginname = '{0}',Username = '******',xingbie = '{2}',gzdw = '{3}',zc = '{4}',phone = '{5}'",
                                        tbx_admin_name.Text.Trim(), tbx_user_name.Text.Trim(), rbtnlist_xb.SelectedValue, tbx_gzdw.Text, tbx_zc.Text, "");
            }
            else
            {
                str_pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(tbx_pwd_new.Text, "MD5");
                str_sql = string.Format("update t_yszj set loginname = '{0}',Username = '******',pwd = '{2}',xingbie = '{3}',gzdw = '{4}',zc = '{5}',phone = '{6}'",
                                        tbx_admin_name.Text.Trim(), tbx_user_name.Text.Trim(), str_pwd, rbtnlist_xb.SelectedValue, tbx_gzdw.Text, tbx_zc.Text, "");
            }
            str_sql = str_sql + " where appyear = year(date()) and sfzh = '" + lbl_id.Text + "'";
        }
        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('用户信息保存成功!');</script>");
            bindData();
            TD_AddUser.Visible = false;
        }
        else
        {
            Response.Write("<script>alert('用户信息保存失败!');</script>");
        }
    }
Exemplo n.º 8
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        DataView dv      = (DataView)Session["dv_detail"];
        string   str_sql = "delete from master where id = " + dv.Table.Rows[e.RowIndex]["id"].ToString();

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('删除成功!');</script>");
            GridView1.DataSource = DBFun.GetDataView("select * from master;");
            GridView1.DataBind();
        }
    }
Exemplo n.º 9
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        DataView dv      = (DataView)Session["dv_detail"];
        string   str_sql = string.Format("delete from t_dict where flm = {0} and bm = {1}",
                                         3, Convert.ToInt16(dv.Table.Rows[e.RowIndex]["bm"]));

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('删除成功!');</script>");
            bindData();
        }
    }
Exemplo n.º 10
0
    protected void Save()
    {
        DropDownList ddlist_pjys;

        for (int i = 1; i <= 6; i++)
        {
            ddlist_pjys = (DropDownList)this.FindControl("ddlist_" + i.ToString());
            if (Convert.ToInt16(ddlist_pjys.SelectedValue) == 0)
            {
                Response.Write("<script>alert('第 " + i.ToString() + " 项数据没有选择!');</script>");
                return;
            }
            ddlist_pjys.Focus();
        }
        if (rbtnList_1.SelectedValue == null || rbtnList_1.SelectedValue == "")
        {
            Response.Write("<script>alert('请选择是否推荐申请人!');</script>");
            return;
        }

        string str_sql = "SELECT count(*) from zjry where sfzh = '" + Session["sfzh"].ToString() +
                         "' and zjid = " + Session["zjid"].ToString();
        string ls_jypj = ftb_jypj.Text.Replace("'", "’");

        if (DBFun.ExecuteScalar(str_sql).ToString() == "1")
        {
            str_sql = string.Format("update zjry set fs_pjys1 = '{0}',fs_pjys2 = '{1}',fs_pjys3 = '{2}'," +
                                    "fs_pjys4 = '{3}',fs_pjys5 = '{4}',fs_pjys6 = '{5}',fs_pjys_sum = '{6}',fs_sftj = '{7}',jypj = '{8}'," +
                                    "psrq = '{9}' where zjid = {10} and sfzh = '{11}'",
                                    ddlist_1.SelectedValue, ddlist_2.SelectedValue, ddlist_3.SelectedValue,
                                    ddlist_4.SelectedValue, ddlist_5.SelectedValue, ddlist_6.SelectedValue, lbl_sum.Text, rbtnList_1.SelectedValue, ls_jypj,
                                    DateTime.Now.ToString("yyyy年MM月dd日"), Convert.ToInt16(Session["zjid"]), Session["sfzh"].ToString());
        }
        else
        {
            str_sql = string.Format("insert into zjry (zjid,sfzh,fs_pjys1,fs_pjys2,fs_pjys3,fs_pjys4,fs_pjys5,fs_pjys6," +
                                    "fs_pjys_sum,fs_sftj,jypj,psrq) values ({0},'{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}')",
                                    Convert.ToInt16(Session["zjid"]), Session["sfzh"].ToString(), ddlist_1.SelectedValue, ddlist_2.SelectedValue, ddlist_3.SelectedValue,
                                    ddlist_4.SelectedValue, ddlist_5.SelectedValue, ddlist_6.SelectedValue, lbl_sum.Text, rbtnList_1.SelectedValue, ls_jypj,
                                    DateTime.Now.ToString("yyyy年MM月dd日"));
        }

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('保存成功!');</script>");
        }
        else
        {
            Response.Write("<script>alert('保存失败!');</script>");
            return;
        }
        bindData();
    }
Exemplo n.º 11
0
    protected void Save(bool b_ShowMsg)
    {
        string          str_sfzh, str_tjjg, str_sql, str_editflag;
        DataView        dv = (DataView)Session["dv_detail"];
        RadioButtonList rbtnList_1;
        TextBox         tbx_fnd;

        for (int i = 0; i < dv.Table.Rows.Count; i++)    //循环GridView每一行
        {
            str_sfzh = dv.Table.Rows[i]["sfzh"].ToString();
            if (i < GridView1.Rows.Count)
            {
                rbtnList_1 = (RadioButtonList)this.GridView1.Rows[i + GridView1.PageIndex * GridView1.PageSize].FindControl("rbtnList_tjjg");
                tbx_fnd    = (TextBox)this.GridView1.Rows[i + GridView1.PageIndex * GridView1.PageSize].FindControl("tbx_ID");
            }
            else
            {
                tbx_fnd = new TextBox();
                int i_count = i + 1;
                tbx_fnd.Text = i_count.ToString();
                rbtnList_1   = new RadioButtonList();
                try { rbtnList_1.SelectedValue = dv.Table.Rows[i]["tj_flag"].ToString(); }
                catch { }
            }
            str_tjjg = rbtnList_1.SelectedValue.ToString();
            if (str_tjjg == "推荐")
            {
                str_editflag = "false";
            }
            else
            {
                str_editflag = "true";
            }
            try { int j = Convert.ToInt16(tbx_fnd.Text); }
            catch
            {
                Response.Write("<script>alert('排序ID只能是数字!');</script>");
                return;
            }
            str_sql = "update cpry set tj_flag = '" + str_tjjg + "' , edit_flag = " + str_editflag + ",id =" + Convert.ToInt16(tbx_fnd.Text) + " where sfzh = '" + str_sfzh + "'";
            if (!DBFun.ExecuteUpdate(str_sql))
            {
                Response.Write("<script>alert('保存失败!');</script>");
                return;
            }
        }
        if (b_ShowMsg)
        {
            Response.Write("<script>alert('保存成功!');</script>");
        }
        bindData();
    }
Exemplo n.º 12
0
    protected void btn_confirm_Click(object sender, EventArgs e)
    {
        string str_pwd  = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(tbx_pwd_new.Text, "MD5");
        string str_sql  = "";
        string str_sftj = Convert.ToString((rbtnlist_sftj.SelectedValue == "已提交"));
        string str_flm  = "";
        string str_flag = "";

        str_flm  = "13";
        str_flag = "tj_flag";

        if (lbl_editflag.Text == "insert")
        {
            str_sql = "SELECT count(*) FROM t_dict WHERE flm = " + str_flm + " and url = '" + tbx_bm.Text + "'";
            if (Convert.ToInt16(DBFun.ExecuteScalar(str_sql)) > 0)
            {
                Response.Write("<script>alert('单位编码已存在!');</script>");
                tbx_bm.Focus();
                return;
            }
            str_sql = " SELECT iif(isnull(max(bm)),1,max(bm)+1) AS maxbm" +
                      "   FROM t_dict" +
                      "  WHERE flm = " + str_flm + ";";
            int i_maxbm = Convert.ToInt16(DBFun.ExecuteScalar(str_sql));
            str_sql = string.Format("Insert Into t_dict (flm,bm,name,url,pwd," + str_flag + ") Values ({0},{1},'{2}','{3}','{4}',{5})",
                                    str_flm, i_maxbm, tbx_dwmc.Text, tbx_bm.Text, str_pwd, str_sftj);
        }
        else
        {
            if (tbx_pwd_new.Text == null || tbx_pwd_new.Text == "")
            {
                str_sql = string.Format("update t_dict set name = '{0}',url = '{1}'," + str_flag + " = {2}",
                                        tbx_dwmc.Text.Trim(), tbx_bm.Text.Trim(), str_sftj);
            }
            else
            {
                str_sql = string.Format("update t_dict set name = '{0}',url = '{1}'," + str_flag + " = {2},pwd = '{3}'",
                                        tbx_dwmc.Text.Trim(), tbx_bm.Text.Trim(), str_sftj, str_pwd);
            }
            str_sql = str_sql + " where flm = " + str_flm + " and  bm = " + lbl_id.Text;
        }
        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('部门信息保存成功!');</script>");
            bindData();
            TD_AddUser.Visible = false;
        }
        else
        {
            Response.Write("<script>alert('部门信息保存失败!');</script>");
        }
    }
Exemplo n.º 13
0
        protected void btn_Add_Click(object sender, EventArgs e)
        {
            //添加

            string strsql = string.Format("Insert into [T_indexpage](film_classid,ImgUrl,templateid) values ({0},'{1}',{2})",
                                          dw_class.Text, tb_ImgUrl.Text, dw_TemplateID.Text);

            if (DBFun.ExecuteUpdate(strsql))
            {
                lbl_msg.Text = "添加成功!";
                binddata();
            }
        }
Exemplo n.º 14
0
    protected void gv_Dept_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        DataView dv      = (DataView)Session["dv_detail"];
        string   str_sql = "13";

        str_sql = "delete from t_dict where flm = " + str_sql + " and bm = " + dv.Table.Rows[e.RowIndex + gv_Dept.PageIndex * gv_Dept.PageSize]["bm"].ToString();

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('删除成功!');</script>");
            bindData();
        }
    }
    protected void btn_InitPwd_Click(object sender, EventArgs e)
    {
        string str_sql = "Update t_dict Set url = '" + tbx_InitPwd.Text + "' Where flm = 8 and bm = 15 ";

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('保存成功!');</script>");
        }
        else
        {
            Response.Write("<script>alert('保存失败!');</script>");
        }
    }
Exemplo n.º 16
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        string str_sql = "update cpry set reason = '" + tbx_Reason.Text + "' where sfzh = '" + Session["sfzh"].ToString() + "'";

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('保存成功!');</script>");
        }
        else
        {
            Response.Write("<script>alert('保存失败!');</script>");
        }
    }
Exemplo n.º 17
0
    protected void btn_InitPwd_Click(object sender, EventArgs e)
    {
        string str_sql = "Update t_dict Set InitPwd = '" + tbx_InitPwd.Text + "' Where flm = 2 and url = '" + Session["admin_id"].ToString() + "'";

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('保存成功!');</script>");
        }
        else
        {
            Response.Write("<script>alert('保存失败!');</script>");
        }
    }
Exemplo n.º 18
0
    protected int Save(bool b_ShowMsg)
    {
        string  strOpid = "";
        string  strsql;
        TextBox tbx_fnd;      //排列顺序号
        TextBox tbx_fnd1;     //排列顺序号 用来比较是否有重复
        int     i_Number = 0; //特殊津贴人员  专家推荐人数

        strsql = "Select count(*) From t_zjry Where appyear=year(date()) And zj_sfzh = '" + Session["admin_id"].ToString() + "' and sftj ";
        DataView dv = (DataView)Session["dv_detail"];

        for (int i = 0; i < gv.Rows.Count; i++)
        {
            CheckBox ckb      = (CheckBox)gv.Rows[i].FindControl("cbx_1");
            string   str_sfzh = dv.Table.Rows[i + gv.PageIndex * gv.PageSize]["jsh"].ToString();

            if (ckb.Checked)
            {
                i_Number++;
                if (strOpid == "")
                {
                    strOpid += ("('" + str_sfzh);
                }
                else
                {
                    strOpid += ("','" + str_sfzh);
                }
            }
        }

        strOpid += "')";
        if (strOpid == "')")
        {
            strOpid = "('')";
        }



        //投票
        strsql = string.Format("update t_zjry set sftj = true where appyear=year(date()) and zj_sfzh='{0}' and cpry_sfzh in {1}", Session["admin_id"].ToString(), strOpid);
        DBFun.ExecuteUpdate(strsql);

        strsql = string.Format("update t_zjry set sftj = false where appyear=year(date()) and zj_sfzh='{0}' and cpry_sfzh not in {1}", Session["admin_id"].ToString(), strOpid);
        DBFun.ExecuteUpdate(strsql);
        if (b_ShowMsg)
        {
            Response.Write("<script>alert('已保存推荐结果!');</script>");
        }
        bindData();
        return(1);
    }
Exemplo n.º 19
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        str_sql = ViewState["sql"].ToString();
        dv      = DBFun.GetDataView(str_sql);
        RadioButtonList rbl_fnd;

        rbl_fnd = (RadioButtonList)this.GridView1.Rows[e.RowIndex].FindControl("rbl_tj");
        str_sql = "update t_ExpertList0 set tj_flag = " + rbl_fnd.SelectedValue + " where appyear=year(date()) and LoginName = '" + dv.Table.Rows[e.RowIndex + GridView1.PageIndex * GridView1.PageSize]["LoginName"].ToString() + "'";
        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('修改成功!');</script>");
            bindData();
        }
    }
Exemplo n.º 20
0
    protected void btn_pingjia_save_Click(object sender, EventArgs e)
    {
        TD1.Visible = false;
        string strsql = string.Format("update cpry set pingjia = '" + TextBox1.Text + "' where sfzh ='" + Session["sfzh"].ToString() + "'");

        if (DBFun.ExecuteUpdate(strsql))
        {
            Response.Write("<script>alert('评价成功!');</script>");
        }
        else
        {
            Response.Write("<script>alert('评价失败!');</script>");
        }
    }
Exemplo n.º 21
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        DataView        dv = (DataView)Session["dv_detail"];
        RadioButtonList rbl_fnd;

        rbl_fnd = (RadioButtonList)this.GridView1.Rows[e.RowIndex].FindControl("rbl_tj");
        string str_sql = "update t_pszj set tj_flag = " + rbl_fnd.SelectedValue + " where appyear=year(date()) and sfzh = '" + dv.Table.Rows[e.RowIndex + GridView1.PageIndex * GridView1.PageSize]["sfzh"].ToString() + "'";

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('修改成功!');</script>");
            bindData();
        }
    }
Exemplo n.º 22
0
    protected void save(string str_bm, string str_Value)
    {
        string str_sql = "update t_dict set url = '" + str_Value + "' where flm = 8 and bm = " + str_bm;

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('保存成功!');</script>");
        }
        else
        {
            Response.Write("<script>alert('保存失败!');</script>");
        }
        bindData();
    }
Exemplo n.º 23
0
 protected void btn_confirm_Click(object sender, EventArgs e)
 {
     TD_AddUser.Visible = false;
     str_sql            = string.Format("update t_teacher_list set yj21 = '" + tbx_yj2.Text + "' where appNo ='" + lbl_appNo.Text + "'");
     if (DBFun.ExecuteUpdate(str_sql))
     {
         Response.Write("<script>alert('意见填写成功!');</script>");
         bindData();
     }
     else
     {
         Response.Write("<script>alert('意见填写失败!');</script>");
     }
 }
Exemplo n.º 24
0
    protected void btn_Change_Click(object sender, EventArgs e)
    {
        string strOldid = "";
        string strNewid = "";
        int    i_count  = 0;

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox ckb = (CheckBox)GridView1.Rows[i].FindControl("cbx_select");

            if (ckb.Checked)
            {
                if (strOldid == "")
                {
                    strOldid = GridView1.Rows[i].Cells[0].Text;
                }
                else
                {
                    strNewid = GridView1.Rows[i].Cells[0].Text;
                }
                i_count++;
            }
        }
        if (i_count != 2)
        {
            Response.Write("<script>alert('选且只能选择两条记录!');</script>");
        }
        else
        {
            //互换
            string    strsql = " select sfzh from t_yszj where appyear=year(date()) and id in (" + strOldid + "," + strNewid + ") ;";
            DataTable dt     = DBFun.dataTable(strsql);
            strOldid = dt.Rows[0][0].ToString();
            strNewid = dt.Rows[1][0].ToString();
            strsql   = " select count(*) from zjry where zj_sfzh = '" + strOldid + "' ;";
            if (Convert.ToInt16(DBFun.ExecuteScalar(strsql)) > 0)
            {
                strsql = " update zjry set zj_sfzh = '" + strNewid + "' where flag = " + lbl_type.Text + " and zj_sfzh = '" + strOldid + "'";
            }
            else
            {
                strsql = " update zjry set zj_sfzh = '" + strOldid + "' where flag = " + lbl_type.Text + " and zj_sfzh = '" + strNewid + "'";
            }
            if (DBFun.ExecuteUpdate(strsql))
            {
                Response.Write("<script>alert('互换成功!');</script>");
                bindData();
            }
        }
    }
Exemplo n.º 25
0
 protected void btn_Ok_Click(object sender, EventArgs e)
 {
     //保存
     if (btn_Ok.Text == "添加")
     {
         try
         {
             string strsql = string.Format("Insert into T_class(Caption,ListImg,Listpagesize,ListSamePageSize,Cidx,"
                                           + "CIsOpen,ListsortType,NotLoginIn,CSort) "
                                           + " values('{0}','{1}',{2},{3},{4},{5},{6},{7},{8})",
                                           tb_Caption.Text, tb_ListImg.Text, tb_ListPageSize.Text, tb_ListSamePageSize.Text, tb_Cidx.Text,
                                           rbl_CIsOpen.Text, rbl_ListSortType.Text, rbl_NotLogin.Text, tb_CSort.Text);
             if (DBFun.ExecuteUpdate(strsql))
             {
                 Response.Write("<script>alert('数据添加成功!');window.location.href='film_classAddEdit.aspx?Action=Edit&id=" + DBFun.SearchValue("select Max(id) from T_class") + "';</script>");
             }
             else
             {
                 Response.Write("<scritp>alert('添加失败!请检查是否填写正确。');</script>");
             }
         }
         catch (Exception ex)
         {
             Response.Write(@"<script>alert('添加失败!请检查是否填写正确!" + ex.Message + "');</script>");
         }
     }
     else if (btn_Ok.Text == "确认修改")
     {
         try
         {
             string strsql = string.Format("Update T_class Set Caption='{0}',ListImg='{1}',Listpagesize={2},ListSamePageSize={3},Cidx={4},"
                                           + "CIsOpen={5},ListsortType={6},NotLoginIn={7} ,Csort={8} where id={9}",
                                           tb_Caption.Text, tb_ListImg.Text, tb_ListPageSize.Text, tb_ListSamePageSize.Text, tb_Cidx.Text,
                                           rbl_CIsOpen.Text, rbl_ListSortType.Text, rbl_NotLogin.Text, tb_CSort.Text, Request.QueryString["ID"]);
             if (DBFun.ExecuteUpdate(strsql))
             {
                 Response.Write("<script>alert('数据修改成功!');document.reload();</script>");
             }
             else
             {
                 Response.Write("<scritp>alert('保存失败!请检查是否填写正确。');</script>");
             }
         }
         catch
         {
             Response.Write("<script>alert('保存失败!请检查是否填写正确!');</script>");
         }
     }
 }
Exemplo n.º 26
0
    protected void btn_confirm_Click(object sender, EventArgs e)
    {
        str_sql = "update t_teacher_list set szbm='" + ddlist_dept.SelectedValue + "',Status=" + ddlist_Status.SelectedValue + " where appNo='" + tbx_appNo.Text + "' ";

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('保存成功!');</script>");
            bindData();
            TD_AddUser.Visible = false;
        }
        else
        {
            Response.Write("<script>alert('保存失败!');</script>");
        }
    }
Exemplo n.º 27
0
    //删除附件
    protected void btn_fj_del_Click(object sender, EventArgs e)
    {
        string str_sql = string.Format("update yxxwlw_cpry set lw_fj = '',lw_fj_displayname = '' where sfzh = '{0}'",
                                       Session["sfzh"].ToString());

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('附件删除成功!');</script>");
        }
        else
        {
            Response.Write("<script>alert('附件删除失败!');</script>");
        }
        bindData();
    }
Exemplo n.º 28
0
    protected void Commit()
    {
        string str_sql = string.Format("update yxxwlw_cpry set edit_flag = {0} where sfzh = '{1}'",
                                       false, Session["sfzh"].ToString());

        if (DBFun.ExecuteUpdate(str_sql))
        {
            string str_url = "PrintPreview_lw.aspx";
            Response.Write("<script>alert('提交成功!');location.href = '" + str_url + "';</script>");
        }
        else
        {
            Response.Write("<script>alert('提交失败!');</script>");
        }
    }
Exemplo n.º 29
0
    protected void btn_confirm_Click(object sender, EventArgs e)
    {
        string str_pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(tbx_pwd.Text, "MD5");
        string str_sql = str_sql = "Update master Set admin_pwd = '" + str_pwd + "' Where id = " + lbl_id.Text;

        if (DBFun.ExecuteUpdate(str_sql))
        {
            Response.Write("<script>alert('密码修改成功!');</script>");
            TD_pwd.Visible = false;
        }
        else
        {
            Response.Write("<script>alert('密码修改失败!');</script>");
        }
    }
Exemplo n.º 30
0
 protected void btn_CreateRws_Click(object sender, EventArgs e)
 {
     str_sql = "delete from t_Rws where appYear=year(date())";
     DBFun.ExecuteSql(str_sql);
     str_sql = "exec C_Rws ";
     if (DBFun.ExecuteUpdate(str_sql))
     {
         Response.Write("<script>alert('生成成功!');</script>");
         bindData();
     }
     else
     {
         Response.Write("<script>alert('生成失败!');</script>");
     }
 }