示例#1
0
        //删除
        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);
            }
        }
示例#2
0
        public DataTable GetAdminsInfoById(AdminsModel model)
        {
            AdminsDAL dal = new AdminsDAL();
            DataTable dt  = dal.GetAdminsInfoById(model);

            return(dt);
        }
示例#3
0
        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);
            }
        }
示例#4
0
文件: AdminsBLL.cs 项目: JacBang/CMS
        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);
            }
        }
示例#5
0
文件: AdminsBLL.cs 项目: JacBang/CMS
        public static bool database(string id)
        {
            int count = AdminsDAL.database(id);

            if (count >= 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#6
0
文件: AdminsBLL.cs 项目: JacBang/CMS
        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);
            }
        }
示例#7
0
        public override bool QueryAll()
        {
            try
            {
                List <AdminsCls> adcList = AdminsDAL.GetAllAdminsCls();

                AdminBindingSource.DataSource = adcList;

                gridControl1.DataSource = AdminBindingSource;

                return(true);
            }
            catch (System.Exception ex)
            {
                return(false);
            }
        }
示例#8
0
        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();
        }
示例#9
0
 public static int updateadmin(AdminsMDL a)
 {
     return(AdminsDAL.updateadmin(a));
 }
示例#10
0
 public static int deleteadmin(AdminsMDL a)
 {
     return(AdminsDAL.deleteadmin(a));
 }
示例#11
0
 //lcy
 public static List <AdminsMDL> getlist(AdminsMDL a)
 {
     return(AdminsDAL.Getlist(a));
 }
示例#12
0
 public static int insertadmin(AdminsMDL a)
 {
     return(AdminsDAL.insertadmin(a));
 }
示例#13
0
 public static string selectpwd(AdminsMDL a)
 {
     return(AdminsDAL.selectpwd(a));
 }
示例#14
0
 public static int updatepwd(AdminsMDL aa, AdminsMDL am)
 {
     return(AdminsDAL.updatepwd(aa, am));
 }
示例#15
0
 public static int logintype(AdminsMDL a)
 {
     return(AdminsDAL.logintype(a));
 }
示例#16
0
 public static List <AdminsMDL> GetLogin(string a)
 {
     return(AdminsDAL.GetLogin(a));
 }
示例#17
0
        public int InsertAdminsInfo(AdminsModel model)
        {
            AdminsDAL dal = new AdminsDAL();

            return(dal.InsertAdminsInfo(model));
        }
示例#18
0
        //保存
        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);
            }
        }
示例#19
0
文件: AdminsBLL.cs 项目: JacBang/CMS
 public static List <Admins> selectall()
 {
     return(AdminsDAL.selectall());
 }