Ejemplo n.º 1
0
        private void edit_bt_Click(object sender, EventArgs e)
        {
            DataRow drt = manuser.GetDataRow(manuser.FocusedRowHandle);

            MessageBox.Show(drt["password"].ToString() + "  " + drt["ID"].ToString());
            Maticsoft.BLL.username   user      = new Maticsoft.BLL.username();
            Maticsoft.Model.username user_mode = user.GetModel(Convert.ToInt32(drt["ID"]));
            password pass_obj = new password();

            pass_obj.user_mode = user_mode;
            pass_obj.Show();
            return;

            for (int i = 0; i < manuser.RowCount; i++)
            {
                string   ua = manuser.GetRowCellValue(i, "user").ToString();
                string   pw = manuser.GetRowCellValue(i, "password").ToString();
                string   po = manuser.GetRowCellValue(i, "power").ToString();
                int      id = Convert.ToInt32(manuser.GetRowCellValue(i, "ID"));
                DateTime tm = Convert.ToDateTime(manuser.GetRowCellValue(i, "addTime"));
                Maticsoft.BLL.username   use = new Maticsoft.BLL.username();
                Maticsoft.Model.username us  = new username()
                {
                    ID       = id,
                    user     = ua,
                    addtime  = tm,
                    password = pw,
                    power    = po,
                };
                use.Update(us);
            }
            MessageBox.Show("修改成功");
        }
Ejemplo n.º 2
0
 private void ShowInfo(int ID)
 {
     Maticsoft.BLL.username   bll   = new Maticsoft.BLL.username();
     Maticsoft.Model.username model = bll.GetModel(ID);
     this.lblID.Text       = model.ID.ToString();
     this.txtusername.Text = model.username;
     this.txtaddtime.Text  = model.addtime.ToString();
     this.txtpassword.Text = model.password;
     this.txtpower.Text    = model.power;
 }