Ejemplo n.º 1
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     //判断session
     if (Session["User"] == null || Session["User"].ToString().Length < 1)
     {
         Response.Redirect(Request.RawUrl);
     }
     try
     {
         int nID = 0;
         if (int.TryParse(hfID.Value.ToString(), out nID) && nID > 0)
         {
             //更新
             if (ValiEdit())
             {
                 DBLL.clsUser       user   = new DBLL.clsUser();
                 DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL();
                 bool _Result = user.update_tb_UserBynUserID(nID, txtsUsername.Text, txtsPassword0.Text, txtsRealName.Text, int.Parse(RadioButtonList1.SelectedValue), txtsUserQQ.Text, txtsUserMSN.Text, txtsUserPhone.Text, txtsUserEmail.Text, int.Parse(RadioButtonList2.SelectedValue), Session["user"].ToString(), DateTime.Now, true, 1, true, true);
                 if (_Result == true)
                 {
                     ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateSuccess");
                     ShowMsg1.Show();
                 }
                 else
                 {
                     //失败就一条
                     ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateFail");
                     ShowMsg1.Show();
                 }
             }
             else
             {
                 ShowMsg1.Show();
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 2
0
 protected void BtnUpdate_Click(object sender, EventArgs e)
 {
     //判断session
     if (Session["User"] == null || Session["User"].ToString().Length < 1)
     {
         Response.Redirect(Request.RawUrl);
     }
     try
     {
         if (ValiEdit())
         {
             DBLL.clsUser       user   = new DBLL.clsUser();
             DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL();
             bool _Result = user.update_tb_UserBynUserID(int.Parse(hfUserUpdateID.Value), txtsUsername.Text, txtsPassword2.Text, txtsRealName.Text, int.Parse(rblnUserSex.SelectedValue), txtsUserQQ.Text, txtsUserMSN.Text, txtsUserPhone.Text, txtsUserEmail.Text, int.Parse(rblnUserType.SelectedValue), Session["user"].ToString(), DateTime.Now, true, 1, cbIsContact.Checked, cbIsInquiry.Checked);
             if (_Result == true)
             {
                 ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateSuccess");
                 ShowMsg1.Show();
                 MultiView1.ActiveViewIndex = 0;
                 ReBindPageList();
             }
             else
             {
                 //失败就一条
                 ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateFail");
                 ShowMsg1.Show();
             }
         }
         else
         {
             ShowMsg1.Show();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }