예제 #1
0
        private void ShowInfo(int ID)
        {
            JiaJiao.BLL.ClassSetting bll = new JiaJiao.BLL.ClassSetting();
            JiaJiao.Model.ClassSetting model = bll.GetModel(ID);
            this.lblID.Text = model.ID.ToString();
            this.lblTotal.Text = model.Total.ToString();
            this.lblCount.Text = model.Count.ToString();

            JiaJiao.BLL.Class bll1 = new BLL.Class();
            var model1 = bll1.GetModel(model.DayId.Value);
            JiaJiao.BLL.Teacher bll2 = new BLL.Teacher();
            var model2 = bll2.GetModel(model.TeacherId);
            this.lblDayId.Text = model1.Day + " " + model1.Time
                ;
            this.lblTeacherId.Text = model2.TeacherName;
        }
예제 #2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";
            if (!PageValidate.IsNumber(this.ddlTeacher.SelectedValue))
            {
                strErr += "请选择一个老师!\\n";
            }

            if (string.IsNullOrWhiteSpace(this.ddlTime.SelectedValue))
            {
                strErr += "请选择时间!\\n";
            }
            if (!PageValidate.IsNumber(txtTotal.Text))
            {
                strErr += "开班人数格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtCount.Text))
            {
                strErr += "报名人数格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int ID = int.Parse(this.lblID.Text);
            int TeacherId = int.Parse(this.ddlTeacher.SelectedValue);
            int DayId = int.Parse(this.ddlTime.SelectedValue);
            int Total = int.Parse(this.txtTotal.Text);
            int Count = int.Parse(this.txtCount.Text);
            DateTime CreateTime = DateTime.Now;
            DateTime UpdateTime = DateTime.Now;

            JiaJiao.Model.ClassSetting model = new JiaJiao.Model.ClassSetting();
            model.ID = ID;
            model.TeacherId = TeacherId;
            model.DayId = DayId;
            model.Total = Total;
            model.Count = Count;
            model.CreateTime = CreateTime;
            model.UpdateTime = UpdateTime;

            JiaJiao.BLL.ClassSetting bll = new JiaJiao.BLL.ClassSetting();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
예제 #3
0
        private void ShowInfo(int ID)
        {
            JiaJiao.BLL.ClassSetting bll = new JiaJiao.BLL.ClassSetting();
            JiaJiao.Model.ClassSetting model = bll.GetModel(ID);
            this.lblID.Text = model.ID.ToString();

            this.txtTotal.Text = model.Total.ToString();
            this.txtCount.Text = model.Count.ToString();

            JiaJiao.BLL.Class bll1 = new BLL.Class();
            var classModel1 = bll1.GetModel(model.DayId.Value);
            JiaJiao.BLL.Teacher bll2 = new BLL.Teacher();
            var teacherModel2 = bll2.GetModel(model.TeacherId);

            JiaJiao.BLL.Teacher t = new BLL.Teacher();
            var ds = t.GetAllList();
            this.ddlTeacher.DataSource = ds.Tables[0];
            this.ddlTeacher.DataBind();
            ddlTeacher.SelectedValue = model.TeacherId.ToString();

            JiaJiao.BLL.Class c = new BLL.Class();
            var clist = c.GetModelList("");
            this.ddlDay.DataSource = clist.GroupBy(d => d.Day).Select(g => g.Key);
            this.ddlDay.DataBind();
            ddlDay.SelectedValue = classModel1.Day;

            this.ddlTime.DataSource = clist.Where(d => d.Day == classModel1.Day);
            this.ddlTime.DataBind();
        }