Beispiel #1
0
        private void comboBoxEdit_Send_StuGrade_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            comboBoxEdit_Send_StuClass.Properties.Items.Clear();
            comboBoxEdit_Send_StuClass.Properties.Items.AddRange(new object[] { "全部" });
            comboBoxEdit_Send_StuClass.SelectedItem = "全部";
            if (getStuInfoByCondition.getGradeInfo(comboBoxEdit_Send_StuGrade.SelectedItem.ToString(), "").Tables[0].Rows.Count > 0)
            {
                //根据年级选择获取年级编号
                getGradeNumberFromCombo = getStuInfoByCondition.getGradeInfo(
                    comboBoxEdit_Send_StuGrade.SelectedItem.ToString(), "").Tables[0].Rows[0][0].ToString();
                foreach (DataRow getClassList in getStuInfoByCondition.getClassInfo("", "",
                                                                                    getGradeNumberFromCombo).Tables[0].Rows)
                {
                    comboBoxEdit_Send_StuClass.Properties.Items.AddRange(
                        new object[] { getClassList[1].ToString() });
                }
            }

            //根据年级查询所选信息
            if (!comboBoxEdit_Send_StuGrade.SelectedItem.ToString().Equals("全部"))
            {
                SelectPhoneInfo(textEdit_Send_StuName.Text.Trim(), textEdit_Send_StuNumber.Text.Trim(),
                                comboBoxEdit_Send_StuGrade.SelectedItem.ToString().Trim(), comboBoxEdit_Send_StuClass
                                .SelectedItem.ToString().Trim());
            }
            else
            {
                SelectPhoneInfo(textEdit_Send_StuName.Text.Trim(), textEdit_Send_StuNumber.Text.Trim(),
                                string.Empty, comboBoxEdit_Send_StuClass.SelectedItem.ToString().Trim());
            }
        }
Beispiel #2
0
        private void repositoryItemComboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            int i = gridView1.GetSelectedRows()[0];

            repositoryItemComboBox2.Items.Clear();
            DevExpress.XtraEditors.ComboBoxEdit cbeGrade = (DevExpress.XtraEditors.ComboBoxEdit)sender;
            string grade = cbeGrade.SelectedItem.ToString();

            if (grade.Length != 0 && !grade.Equals("不选择"))
            {
                repositoryItemComboBox2.Items.Add("不选择");
                GetStuInfoByCondition getStuInfoByCondition = new GetStuInfoByCondition();
                string getGradeNumberFromCombo = getStuInfoByCondition.getGradeInfo(
                    grade, "").Tables[0].Rows[0][0].ToString();
                foreach (DataRow getClassList in getStuInfoByCondition.getClassInfo("", "",
                                                                                    getGradeNumberFromCombo).Tables[0].Rows)
                {
                    repositoryItemComboBox2.Items.AddRange(
                        new object[] { getClassList[1].ToString() });
                }
            }
            else
            {
                if (grade.Equals("不选择"))
                {
                    repositoryItemComboBox2.Items.Clear();
                    repositoryItemComboBox2.Items.Add("不选择");
                }
            }

            gridView1.SetRowCellValue(i, gridView1.Columns["指定班级"], null);
            gridView1.SetRowCellValue(i, gridView1.Columns["指定年级"], grade);
        }
Beispiel #3
0
        private void SMSPhoneNumChoose_Load(object sender, System.EventArgs e)
        {
            getStuInfoByCondition = new GetStuInfoByCondition();

            PhoneNum     = new SMSInfoSystem().GetAllStuPhoneNum();        //学生卡
            PhoneNumView = PhoneNum.Tables[0].DefaultView;

            gridControl2.DataSource = PhoneNumView;

            comboBoxEdit_Send_StuGrade.Properties.Items.Clear();
            comboBoxEdit_Send_StuGrade.Properties.Items.AddRange(new object[] { "全部" });
            comboBoxEdit_Send_StuGrade.SelectedItem = "全部";
            foreach (DataRow getGradeList in getStuInfoByCondition.getGradeInfo("", "").Tables[0].Rows)
            {
                comboBoxEdit_Send_StuGrade.Properties.Items.AddRange(
                    new object[] { getGradeList[1].ToString() });
            }
        }
Beispiel #4
0
        public PhoneNum()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitForm call

            getStuInfoByCondition = new GetStuInfoByCondition();

            StuList = new CardInfoSystem().GetStuCardInfoList();            //学生卡

            if (Thread.CurrentPrincipal.Identity.Name.ToLower() == "admin")
            {
                return;
            }

            DataSet TeaDept = new RolesSystem().GetRolesDuty(Convert.ToInt32(Thread.CurrentPrincipal.Identity.Name));

            string rowFilter = string.Empty;

            if (!Thread.CurrentPrincipal.IsInRole("园长") &&
                !Thread.CurrentPrincipal.IsInRole("保健"))
            {
                rowFilter = rowFilter + "info_gradeName = '"
                            + TeaDept.Tables[0].Rows[0][0].ToString() + "'";
                rowFilter = rowFilter + " and info_className = '"
                            + TeaDept.Tables[0].Rows[0][1].ToString() + "'";
            }

            StuView           = StuList.Tables[0].DefaultView;
            StuView.RowFilter = rowFilter;

            gridControl1.DataSource = StuView;


            comboBoxEdit_Send_StuGrade.Properties.Items.Clear();
            comboBoxEdit_Send_StuGrade.Properties.Items.AddRange(new object[] { "全部" });
            comboBoxEdit_Send_StuGrade.SelectedItem = "全部";
            foreach (DataRow getGradeList in getStuInfoByCondition.getGradeInfo("", "").Tables[0].Rows)
            {
                comboBoxEdit_Send_StuGrade.Properties.Items.AddRange(
                    new object[] { getGradeList[1].ToString() });
            }
        }