Beispiel #1
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();
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            TrainPlanEmployeeBLL trainPlanEmployeeBLL = new TrainPlanEmployeeBLL();
            ArrayList            objList = trainPlanEmployeeBLL.GetEmployeeList(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.TrainPlanEmployee trainPlanEmployee = new RailExam.Model.TrainPlanEmployee();
                    trainPlanEmployee.TrainPlanID         = Convert.ToInt32(ViewState["PlanID"].ToString());
                    trainPlanEmployee.TrainPlanEmployeeID = Convert.ToInt32(activeItem[1]);

                    trainPlanEmployeeBLL.AddTrainPlanEmployee(trainPlanEmployee);
                }
            }
            Grid2.DataBind();
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            TrainTypeExerciseBLL objBll  = new TrainTypeExerciseBLL();
            ArrayList            objList = GetPaperList();

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

            foreach (GridItem activeItem in activeItems)
            {
                if (objList.IndexOf(activeItem[1]) == -1)
                {
                    TrainTypeExercise obj = new TrainTypeExercise();
                    obj.TrainTypeID = Convert.ToInt32(ViewState["TrainTypeID"].ToString());
                    obj.PaperID     = Convert.ToInt32(activeItem[1]);

                    objBll.AddTrainTypeExercise(obj);
                }
            }
            BindGrid();
            BindGridSelect();
        }