private void LoadItem(int UserID)
        {
            DataAccess db = new DataAccess();
            user = db.AdminUnitGet(UserID);

            edtName.Text = user.name;
            edtPassword.Password = user.password;
            edtPasswordConfirm.Password = user.password;
            edtIsAdmin.IsChecked = user.is_admin > 0;
        }
 private admin_unit SaveItem()
 {
     if (user == null)
         user = new admin_unit();
     user.name = edtName.Text;
     user.password = edtPassword.Password;
     user.is_admin = edtIsAdmin.IsChecked.HasValue ? (edtIsAdmin.IsChecked.Value ? 1 : 0) : 0;
     return user;
 }
 /// <summary>
 /// Create a new admin_unit object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 /// <param name="is_admin">Initial value of the is_admin property.</param>
 /// <param name="password">Initial value of the password property.</param>
 public static admin_unit Createadmin_unit(global::System.Int32 id, global::System.String name, global::System.Int32 is_admin, global::System.String password)
 {
     admin_unit admin_unit = new admin_unit();
     admin_unit.id = id;
     admin_unit.name = name;
     admin_unit.is_admin = is_admin;
     admin_unit.password = password;
     return admin_unit;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the admin_unit EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToadmin_unit(admin_unit admin_unit)
 {
     base.AddObject("admin_unit", admin_unit);
 }
Beispiel #5
0
 public void AdminUnitEdit(admin_unit item)
 {
     admin_unit original = objDataContext.admin_unit.FirstOrDefault(b => b.id == item.id);
     if (original != null)
     {
         original.name = item.name;
         original.password = item.password;
         original.is_admin = item.is_admin;
         objDataContext.SaveChanges();
     }
 }
Beispiel #6
0
 public void AdminUnitCreate(admin_unit _obj)
 {
     objDataContext.AddToadmin_unit(_obj);
     objDataContext.SaveChanges();
 }