示例#1
0
        private void table1_CellDoubleClick(object sender, XPTable.Events.CellMouseEventArgs e)
        {
            _SELECTED_ROW = e.Row;

            FmUserDetail fm = new FmUserDetail();

            fm.txtName.Text       = tableModel1.Rows[e.Row].Cells[2].Text;
            fm.txtLastname.Text   = tableModel1.Rows[e.Row].Cells[3].Text;
            fm.txtNickname.Text   = tableModel1.Rows[e.Row].Cells[4].Text;
            fm.txtMobile.Text     = tableModel1.Rows[e.Row].Cells[7].Text.Replace("-", "");
            fm.txtEmail.Text      = tableModel1.Rows[e.Row].Cells[8].Text;
            fm.cbxUserGroup.Text  = tableModel1.Rows[e.Row].Cells[5].Text;
            fm.rdbActive.Checked  = tableModel1.Rows[e.Row].Cells[1].Text == "1";
            fm.rdbDisable.Checked = tableModel1.Rows[e.Row].Cells[1].Text == "0";

            fm.data = fm.txtName.Text + fm.txtLastname.Text + fm.txtNickname.Text + fm.txtMobile.Text +
                      fm.txtEmail.Text + fm.cbxUserGroup.SelectedItem.ToString() + fm.rdbActive.Checked.ToString();
            fm.CheckInput(sender, e);
            var result = fm.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                Param.UserUpdateEntity           = new UserUpdateEntity(Param.ShopId, tableModel1.Rows[e.Row].Cells[6].Text.ToLower());
                Param.UserUpdateEntity.Firstname = fm.txtName.Text.Trim();
                Param.UserUpdateEntity.Lastname  = fm.txtLastname.Text.Trim();
                Param.UserUpdateEntity.Nickname  = fm.txtNickname.Text.Trim();
                Param.UserUpdateEntity.Mobile    = fm.txtMobile.Text.Trim();
                Param.UserUpdateEntity.Email     = fm.txtEmail.Text.Trim();
                Param.UserUpdateEntity.UserGroup = fm.cbxUserGroup.SelectedItem.ToString();
                Param.UserUpdateEntity.Active    = fm.rdbActive.Checked;
                bwUpdateData.RunWorkerAsync();
            }
            else if (result == DialogResult.No)
            {
                Param.UserUpdateEntity      = new UserUpdateEntity(Param.ShopId, tableModel1.Rows[e.Row].Cells[6].Text.ToLower());
                Param.UserUpdateEntity.ETag = "*";
                bwDeleteData.RunWorkerAsync();
            }
        }
示例#2
0
        private void table1_CellDoubleClick(object sender, XPTable.Events.CellMouseEventArgs e)
        {
            _SELECTED_ROW = e.Row;

            FmUserDetail fm = new FmUserDetail();
            fm.txtName.Text = tableModel1.Rows[e.Row].Cells[2].Text;
            fm.txtLastname.Text = tableModel1.Rows[e.Row].Cells[3].Text;
            fm.txtNickname.Text = tableModel1.Rows[e.Row].Cells[4].Text;
            fm.txtMobile.Text = tableModel1.Rows[e.Row].Cells[7].Text.Replace("-", "");
            fm.txtEmail.Text = tableModel1.Rows[e.Row].Cells[8].Text;
            fm.cbxUserGroup.Text = tableModel1.Rows[e.Row].Cells[5].Text;
            fm.rdbActive.Checked = tableModel1.Rows[e.Row].Cells[1].Text == "1";
            fm.rdbDisable.Checked = tableModel1.Rows[e.Row].Cells[1].Text == "0";

            fm.data = fm.txtName.Text + fm.txtLastname.Text + fm.txtNickname.Text + fm.txtMobile.Text +
                fm.txtEmail.Text + fm.cbxUserGroup.SelectedItem.ToString() + fm.rdbActive.Checked.ToString();
            fm.CheckInput(sender, e);
            var result = fm.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                Param.UserUpdateEntity = new UserUpdateEntity(Param.ShopId, tableModel1.Rows[e.Row].Cells[6].Text.ToLower());
                Param.UserUpdateEntity.Firstname = fm.txtName.Text.Trim();
                Param.UserUpdateEntity.Lastname = fm.txtLastname.Text.Trim();
                Param.UserUpdateEntity.Nickname = fm.txtNickname.Text.Trim();
                Param.UserUpdateEntity.Mobile = fm.txtMobile.Text.Trim();
                Param.UserUpdateEntity.Email = fm.txtEmail.Text.Trim();
                Param.UserUpdateEntity.UserGroup = fm.cbxUserGroup.SelectedItem.ToString();
                Param.UserUpdateEntity.Active = fm.rdbActive.Checked;
                bwUpdateData.RunWorkerAsync();
            }
            else if (result == DialogResult.No)
            {
                Param.UserUpdateEntity = new UserUpdateEntity(Param.ShopId, tableModel1.Rows[e.Row].Cells[6].Text.ToLower());
                Param.UserUpdateEntity.ETag = "*";
                bwDeleteData.RunWorkerAsync();
            }
        }