コード例 #1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "tongyi")
            {
                Panel1.Visible = false;
                Panel2.Visible = false;
                //获取行号
                BLL.B_Card b_card = new BLL.B_Card();
                //webclass.Show(this, selectID.ToString());
                GridViewRow drv     = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
                int         UID     = Convert.ToInt32(GridView1.DataKeys[drv.RowIndex].Value);
                int         adminID = int.Parse(Session["UID"].ToString());
                bool        result  = b_card.updateReason("", UID, adminID, 5);
                //webclass.Show(this,ID.ToString());
                if (result == true)
                {
                    webclass.Show(this, "操作成功");
                    GridView1.DataBind();
                }
                else
                {
                    webclass.Show(this, "操作失败");
                }
            }
            if (e.CommandName == "reject")
            {
                GridViewRow drv = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
                int         ID  = Convert.ToInt32(GridView1.DataKeys[drv.RowIndex].Value);//专家ID
                Panel1.Visible = true;

                Panel2.Visible = false;
                selectID       = ID;
                //webclass.Show(this,selectID.ToString());
            }
            if (e.CommandName == "search")
            {
                GridViewRow     drv     = ((GridViewRow)(((LinkButton)(e.CommandSource)).Parent.Parent));
                int             ID      = Convert.ToInt32(GridView1.DataKeys[drv.RowIndex].Value);//ID
                BLL.B_ApplyInfo b_apply = new BLL.B_ApplyInfo();
                //webclass.Show(this,ID.ToString());
                Model.ApplyInfo applyInfo = new Model.ApplyInfo();
                applyInfo = b_apply.getInfo(ID, 0);
                if (applyInfo != null)
                {
                    label1.Text    = applyInfo.Id.ToString();
                    label2.Text    = applyInfo.UID.ToString();
                    label3.Text    = applyInfo.ApplyTime.ToString();
                    label4.Text    = applyInfo.Age.ToString();
                    label5.Text    = applyInfo.Gender.ToString();
                    label6.Text    = applyInfo.Address.ToString();
                    label7.Text    = applyInfo.Tel.ToString();
                    label8.Text    = applyInfo.Job.ToString();
                    label9.Text    = applyInfo.Money.ToString();
                    label10.Text   = applyInfo.Types.ToString();
                    Panel1.Visible = false;
                    Panel2.Visible = true;
                }
            }
        }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddl_Age.Items.Clear();
         ddl_Age.Items.Add(" ");
         for (int i = 65; i < 150; i++)
         {
             ddl_Age.Items.Add(i.ToString());
         }
         BLL.B_ApplyInfo b_apply = new BLL.B_ApplyInfo();
         model = b_apply.getInfo((int)Session["UID"], (int)Session["ApplyTypes"]);
         if (model != null)
         {
             for (int i = 0; i < ddl_Age.Items.Count; i++)
             {
                 if (ddl_Age.Items[i].Value == model.Age.ToString())
                 {
                     ddl_Age.SelectedIndex = i;
                 }
             }
             BLL.B_UInfo b_uinfo = new BLL.B_UInfo();
             Model.UInfo uinfo   = b_uinfo.GetUInfo(model.UID);
             if (uinfo != null)
             {
                 tb_Name.Text   = uinfo.Name;
                 tb_Number.Text = uinfo.Number;
             }
             tb_Addr.Text             = model.Address;
             rbl_Gender.SelectedValue = model.Gender;
             tb_Job.Text   = model.Job;
             tb_Money.Text = model.Money.ToString();
             tb_Tel.Text   = model.Tel;
         }
     }
 }