Пример #1
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            TrainPlanCourseBLL objBll      = new TrainPlanCourseBLL();
            GridItemCollection activeItems = Grid2.GetCheckedItems(Grid2.Levels[0].Columns[0]);

            foreach (GridItem activeItem in activeItems)
            {
                RailExam.Model.TrainPlanCourse obj = new RailExam.Model.TrainPlanCourse();
                obj.TrainPlanID   = Convert.ToInt32(ViewState["PlanID"].ToString());
                obj.TrainCourseID = Convert.ToInt32(activeItem[1]);

                objBll.DeleteTrainPlanCourse(obj.TrainPlanID, obj.TrainCourseID);
            }
            BindGridQuery();
            Grid2.DataBind();
        }
Пример #2
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            TrainPlanCourseBLL objBll  = new TrainPlanCourseBLL();
            ArrayList          objList = objBll.GetCourseList(Convert.ToInt32(ViewState["PlanID"].ToString()));

            GridItemCollection activeItems = Grid1.GetCheckedItems(Grid1.Levels[0].Columns[0]);

            foreach (GridItem activeItem in activeItems)
            {
                if (objList.IndexOf(activeItem[1]) == -1)
                {
                    RailExam.Model.TrainPlanCourse obj = new RailExam.Model.TrainPlanCourse();
                    obj.TrainPlanID   = Convert.ToInt32(ViewState["PlanID"].ToString());
                    obj.TrainCourseID = Convert.ToInt32(activeItem[1]);

                    objBll.AddTrainPlanCourse(obj);
                }
            }
            Grid2.DataBind();
        }