Exemplo n.º 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;
        }
Exemplo n.º 2
0
        private void EditData(string id, HttpContext context)
        {
            var teaBll = new BLL.Teacher();
            var teaModel = teaBll.GetModel(new Guid(id));
            teaModel.LastModifyTime = DateTime.Now;
            var result = false;
            var msg = "";
            try
            {
                SetModelValue(teaModel, context);
                result = teaBll.Update(teaModel);
                if (!result)
                {
                    msg = "保存失败!";
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLogofExceptioin(ex);
                result = false;
                msg = ex.Message;

            }

            //  var str = JsonConvert.SerializeObject(new { success = result, errorMsg = msg});
            context.Response.Write(msg);
        }
Exemplo n.º 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();
        }