Ejemplo n.º 1
0
 private void set_admin(object sender, RoutedEventArgs e)
 {
     CheckBox cb = (CheckBox)sender;
     ConfirmDialog ms = new ConfirmDialog("授权提示", "确实有必要为该用户赋予管理员权限吗?取得管理员权限后,该用户将可以改动本人信息之外的数据。");
     if (ms.ShowDialog() == false)
         cb.IsChecked = false;
     else
         cb.IsChecked = true;
 }
Ejemplo n.º 2
0
        public void Add_ePhoto(object sender, RoutedEventArgs e)
        {
            try
            {

            byte[] ss = Utils.Utils.LoadImage();
           
            if (ss != null)
            {
                this.ePhoto.Source = Utils.Utils.ByteArrayToBitmapImage(ss);
            }
            }
            catch (Exception ees)
            {
                ConfirmDialog cfd = new ConfirmDialog("更改图片", "更改图片失败!:");
                cfd.ShowDialog();
            }
        }
Ejemplo n.º 3
0
        public void deleIterm(object sender, RoutedEventArgs e)
        {
            string id ;
            try
            {


                 id = ((Button)sender).Tag.ToString();
            }
            catch (Exception ee)
            {
                Message ms = new Message("错误提示", "传入参数错误!。");
                ms.ShowDialog();
                return;
            }
            //dia.Owner = this;

            int _id = 0;
            try
            {
                _id = Int16.Parse(id);
            }
            catch (Exception e_record)
            {
                //
                Message msg = new Message("删除","找寻记录失败!指定的数据不正确或者记录已经不存在了。");
                msg.ShowDialog();
                return;
            }
            Schedule sc = this.db.getScheduleById(_id);
            ConfirmDialog dia = new ConfirmDialog("删除用户", "确定要删除订单" + sc.ORDERNUMBER +"下的记录" +sc.courseName+"吗?删除后数据将不能恢复!");
            if (dia.ShowDialog() == true)
            {
                this.db.Delete_("ORDERS", "_id = " + _id);
                this.LoadData();
            }
        }
Ejemplo n.º 4
0
        public void deleIterm(object sender, RoutedEventArgs e)
        {
            string RecordId = ((Button)sender).Tag.ToString();
            int _id = 0;
            try
            {
                _id = Int16.Parse(RecordId);
            }
            catch (Exception e_record)
            {
                //
                Message msg = new Message("删除", "找寻记录失败!指定的数据不正确或者记录已经不存在了。");
                msg.ShowDialog();
                return;
            }
            Teacher teacher = this.db.getTeacherById(_id);
            ConfirmDialog dia = new ConfirmDialog("删除讲师资料", "确定要删除讲师" + RecordId + "[" + teacher.NAME + "]" + "的资料吗?删除后数据将不能恢复!");
            //dia.Owner = this;


            if (dia.ShowDialog() == true)
            {

                this.db.Delete("TEACHER", "_id = " + _id);
                this.LoadData();
            }

        }
Ejemplo n.º 5
0
        public void deleIterm(object sender, RoutedEventArgs e)
        {
            string RecordId = ((Button)sender).Tag.ToString();
            int _id = 0;
            try
            {
                _id = Int16.Parse(RecordId);
            }
            catch (Exception e_record)
            {
                //
                Message msg = new Message("删除", "找寻记录失败!指定的数据不正确或者记录已经不存在了。");
                msg.ShowDialog();
                return;
            }
            Student stu = this.db.getStudentById(_id);
            if (stu.USERNAME.Equals("admin"))
            {
                Message msg = new Message("警告", "用户[ " + stu.USERNAME + "]是系统保留管理员账户,不允许删除!");
                msg.ShowDialog();
                return;
            }
            ConfirmDialog dia = new ConfirmDialog("删除用户", "确定要删除用户" + RecordId + "[" + stu.NAME + "]" + "吗?删除后数据将不能恢复!");
            //dia.Owner = this;


            if (dia.ShowDialog() == true)
            {
                
                this.db.Delete("USER", "_id = " + _id);
                this.LoadData();
            }
            
        }