//删除 public override bool DeleteData() { try { if (XtraMessageBox.Show("是否删除选中的数据?", "友情提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { int[] rows = gridView1.GetSelectedRows(); for (int i = 0; i < rows.Length; i++) { AdminsCls val = (AdminsCls)gridView1.GetRow(rows[i]); AdminsDAL.DeleteAdminsById(val.Id); } } QueryAll(); init_cmbbox(); return(true); } catch (System.Exception ex) { return(false); } }
public DataTable GetAdminsInfoById(AdminsModel model) { AdminsDAL dal = new AdminsDAL(); DataTable dt = dal.GetAdminsInfoById(model); return(dt); }
public void init_cmbbox() { cmbObjectList.Items.Clear(); var val = AdminsDAL.GetAllAdmins().ToList(); for (int i = 0; i < val.Count; i++) { cmbObjectList.Items.Add(val[i].UserName); } }
public static bool insert(string name, string pwd, string UserCompellation) { int count = AdminsDAL.insert(name, pwd, UserCompellation); if (count >= 1) { return(true); } else { return(false); } }
public static bool database(string id) { int count = AdminsDAL.database(id); if (count >= 1) { return(true); } else { return(false); } }
public static bool update(string name, string pname, string id) { int count = AdminsDAL.update(name, pname, id); if (count >= 1) { return(true); } else { return(false); } }
public override bool QueryAll() { try { List <AdminsCls> adcList = AdminsDAL.GetAllAdminsCls(); AdminBindingSource.DataSource = adcList; gridControl1.DataSource = AdminBindingSource; return(true); } catch (System.Exception ex) { return(false); } }
public override bool RefreshData() { try { string UserName = this.ItemObjectList.EditValue.ToString(); AdminsCls val = AdminsDAL.QueryAdmin(UserName); AdminBindingSource.DataSource = val; gridControl1.DataSource = AdminBindingSource; return(true); } catch (System.Exception ex) { return(false); } //return base.RefreshData(); }
public static int updateadmin(AdminsMDL a) { return(AdminsDAL.updateadmin(a)); }
public static int deleteadmin(AdminsMDL a) { return(AdminsDAL.deleteadmin(a)); }
//lcy public static List <AdminsMDL> getlist(AdminsMDL a) { return(AdminsDAL.Getlist(a)); }
public static int insertadmin(AdminsMDL a) { return(AdminsDAL.insertadmin(a)); }
public static string selectpwd(AdminsMDL a) { return(AdminsDAL.selectpwd(a)); }
public static int updatepwd(AdminsMDL aa, AdminsMDL am) { return(AdminsDAL.updatepwd(aa, am)); }
public static int logintype(AdminsMDL a) { return(AdminsDAL.logintype(a)); }
public static List <AdminsMDL> GetLogin(string a) { return(AdminsDAL.GetLogin(a)); }
public int InsertAdminsInfo(AdminsModel model) { AdminsDAL dal = new AdminsDAL(); return(dal.InsertAdminsInfo(model)); }
//保存 public override bool SaveDataA() { try { if (AddorModify == AddOrModifyEnum.Add) { AdminsCls val = new AdminsCls(); val.UserName = this.textEdit1.Text.ToString(); val.PassWord = this.textEdit2.Text.ToString(); val.Role = this.textEdit3.Text.ToString(); int re = AdminsDAL.AddAdmin(val); AdminBindingSource.DataSource = val; gridControl1.DataSource = AdminBindingSource; // AdminBindingSource.DataSource=; textEdit1.Text = ""; textEdit2.Text = ""; textEdit3.Text = ""; //this.layoutControl1.Enabled = false; this.layoutControlGroup1.Enabled = false; if (re > 0) { MessageBox.Show("新用户添加成功!"); return(true); } else { return(false); } } else if (AddorModify == AddOrModifyEnum.Modify) { adcModify.UserName = textEdit1.Text.ToString(); adcModify.PassWord = textEdit2.Text.ToString(); adcModify.Role = textEdit3.Text.ToString(); int re = AdminsDAL.ModifyAdmins(adcModify); this.layoutControlGroup1.Enabled = false; AdminBindingSource.DataSource = adcModify; gridControl1.DataSource = AdminBindingSource; if (re > 0) { MessageBox.Show("修改成功!"); return(true); } else { return(false); } } else { return(false); } } catch (System.Exception ex) { return(false); } }
public static List <Admins> selectall() { return(AdminsDAL.selectall()); }