public void UpdateTrainTypeExercise(TrainTypeExercise obj) { Database db = DatabaseFactory.CreateDatabase(); string sqlCommand = "USP_TRAIN_TYPE_EXERCISE_U"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "p_train_type_id", DbType.Int32, obj.TrainTypeID); db.AddInParameter(dbCommand, "p_paper_id", DbType.Int32, obj.PaperID); db.ExecuteNonQuery(dbCommand); }
protected void btnDel_Click(object sender, EventArgs e) { TrainTypeExerciseBLL objBll = new TrainTypeExerciseBLL(); GridItemCollection activeItems = Grid2.GetCheckedItems(Grid2.Levels[0].Columns[0]); foreach (GridItem activeItem in activeItems) { TrainTypeExercise obj = new TrainTypeExercise(); obj.TrainTypeID = Convert.ToInt32(ViewState["TrainTypeID"].ToString()); obj.PaperID = Convert.ToInt32(activeItem[1]); objBll.DelTrainTypeExercise(obj.TrainTypeID, obj.PaperID); } BindGrid(); BindGridSelect(); }
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(); }
public IList <TrainTypeExercise> GetTrainTypeExerciseByTrainTypeID(int trainTypeID) { IList <TrainTypeExercise> objList = new List <TrainTypeExercise>(); Database db = DatabaseFactory.CreateDatabase(); string sqlCommand = "USP_TRAIN_TYPE_EXERCISE_G"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "p_train_type_id", DbType.Int32, trainTypeID); db.AddInParameter(dbCommand, "p_paper_id", DbType.Int32, 0); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { TrainTypeExercise obj = CreateModelObject(dataReader); objList.Add(obj); } } return(objList); }
public void UpdateTrainTypeExercise(TrainTypeExercise trainTypeExercise) { dal.UpdateTrainTypeExercise(trainTypeExercise); }
public void AddTrainTypeExercise(TrainTypeExercise trainTypeExercise) { dal.AddTrainTypeExercise(trainTypeExercise); }