public void SaveData()
        {
            if (txtPassword.Text.Trim() != txtPasswordConfirm.Text.Trim())
            {
                X.Msg.Alert("Error","Please review password, both must be same").Show();
                return;
            }
            if (cmbLevel.IsEmpty)
            {
                X.Msg.Alert("Error", "Please select a level for this user").Show();
                return;
            }

            User u = new User();
            u.Userid = txtUserId.Text.Trim();
            u.Password = HelperCrypto.MD5(txtPassword.Text.Trim());
            u.Level = cmbLevel.SelectedItem.Value;
            u.Nama = txtNama.Text.Trim();
            u.Jabatan = txtJabatan.Text;
            u.Divisi = txtBagian.Text;
            u.Lokasi = txtLokasi.Text;
            u.Save();
            HttpContext.Current.Session["isEditUser"] = true;
            X.AddScript("parentAutoLoadControl.close(); Delay='2' ");
        }
 public void DoYes(string userid)
 {
     BusinessObjects.User u = new User();
     if (u.LoadByPrimaryKey(userid.Trim()))
     {
         u.MarkAsDeleted();
         u.Save();
         HttpContext.Current.Session["isEditUser"] = true;
     }
 }
 public void SaveData()
 {
     if (string.IsNullOrEmpty(cmbLevel.SelectedItem.Value.Trim()))
         return;
     BusinessObjects.User u = new User();
     if (u.LoadByPrimaryKey(txtUserId.Text.Trim()))
     {
         u.Nama = txtNama.Text.Trim();
         u.Lokasi = txtLokasi.Text.Trim();
         u.Jabatan = txtJabatan.Text.Trim();
         u.Divisi = txtBagian.Text.Trim();
         u.Level = cmbLevel.SelectedItem.Value.Trim();
         if (chkAktif.Checked)
             u.Aktif = "Y";
         else
             u.Aktif = "N";
         u.Save();
     }
     HttpContext.Current.Session["isEditUser"] = true;
     X.AddScript("parentAutoLoadControl.close(); Delay='2' ");
 }