Esempio n. 1
0
        public FrmEidtReader(Readers reader)
        {
            InitializeComponent();
            //初始化角色下拉框
            this.cboReaderRole.DataSource    = readerService.GetAllReaderRole();
            this.cboReaderRole.DisplayMember = "RoleName";
            this.cboReaderRole.ValueMember   = "RoleId";

            //显示读者信息
            this.txtAddress.Text  = reader.ReaderAddress;
            this.txtPhone.Text    = reader.PhoneNumber;
            this.txtPostcode.Text = reader.PostCode;
            if (reader.Gender == "男")
            {
                this.rdoMale.Checked = true;
            }
            else
            {
                this.rdoFemale.Checked = true;
            }
            this.txtReaderName.Text  = reader.ReaderName;
            this.txtReadingCard.Text = reader.ReadingCard;
            this.cboReaderRole.Text  = reader.RoleName;
            this.pbReaderPhoto.Image = reader.ReaderImage != "" ? (Image) new Common.SerializeObjectToString().DeserializeObject(reader.ReaderImage) : null;

            readerEndit = reader;//保存当前读者对象,为后面的修改使用
        }
        public FrmReaderManger()
        {
            InitializeComponent();
            //初始化办证角色下拉框
            DataTable dt = readerService.GetAllReaderRole();

            this.cboReaderRole.DataSource    = dt;
            this.cboReaderRole.DisplayMember = "RoleName";
            this.cboReaderRole.ValueMember   = "RoleId";

            //用于查询角色(初始化)
            this.cboRole.DataSource    = dt.Copy();//复制后在复制防止选择时同步变化
            this.cboRole.DisplayMember = "RoleName";
            this.cboRole.ValueMember   = "RoleId";


            //初始化按钮禁用
            this.btnEdit.Enabled   = false;
            this.btnEnable.Enabled = false;
        }
 //会员全部角色查询
 public DataTable GetAllReaderRole()
 {
     return(objReaderService.GetAllReaderRole());
 }
Esempio n. 4
0
 public DataTable GetAllReaderRole()
 {
     return(readerService.GetAllReaderRole().Tables[0]);
 }