Ejemplo n.º 1
0
 public int TMS_CourseCoordinate_UpdateDAL(CourseCoordinatorMapping _Coordinate, long CourseId)
 {
     return(ExecuteScalarInt32Sp("TMS_CourseCoordinator_Update",
                                 ParamBuilder.Par("ID", _Coordinate.ID),
                                 ParamBuilder.Par("CoordinateID", _Coordinate.ID),
                                 ParamBuilder.Par("CourseID", CourseId),
                                 ParamBuilder.Par("ModifiedBy", _Coordinate.ModifiedBy),
                                 ParamBuilder.Par("ModifiedDate", _Coordinate.ModifiedDate)));
 }
Ejemplo n.º 2
0
        //public List<CourseCoordinate> CourseCoordinatorMapping(long CourseID)
        //{
        //    List<CourseCoordinate> Course = new List<CourseCoordinate>();
        //    using (var conn = new SqlConnection(DBHelper.ConnectionString))
        //    {
        //        conn.Open();
        //        DynamicParameters dbParams = new DynamicParameters();
        //        dbParams.AddDynamicParams(new { CourseID = CourseID });
        //        using (var multi = conn.QueryMultiple("TMS_CourseCoordinator_GetAll", dbParams, commandType: System.Data.CommandType.StoredProcedure))
        //        {
        //            Course = multi.Read<CourseCoordinate>().AsList<CourseCoordinate>();
        //          //  Total = multi.Read<int>().FirstOrDefault<int>();
        //        }

        //        conn.Close();
        //    }
        //    return Course.ToList();
        //}


        /// <returns>List&lt;Classes&gt;.</returns>
        //public IList<CourseCoordinatorMapping> TMS_CourseCoordinator_GetAllDAL(long CourseId)
        //{
        //    //var _CourseLanguageData = ExecuteListSp<CourseCoordinatorMapping>(@"TMS_CourseCoordinator_GetAll", ParamBuilder.Par("CourseID", CourseId));

        //    //return _CourseLanguageData;

        //    //List<CourseCoordinatorMapping> LoginUserList = new List<CourseCoordinatorMapping>();
        //    //var conString = DBHelper.ConnectionString;
        //    //using (var conn = new SqlConnection(conString))
        //    //{
        //    //    conn.Open();
        //    //    string qry = @"TMS_CourseCoordinator_GetAll";
        //    //    DynamicParameters param = new DynamicParameters(new { CourseID = CourseId });
        //    //    var ClassTraineeMappingDictionary = new Dictionary<long, CourseCoordinatorMapping>();
        //    //    LoginUserList = conn.Query<CourseCoordinatorMapping, Person, CourseCoordinatorMapping>(
        //    //           qry, (loginUsers, person) =>
        //    //           {
        //    //               CourseCoordinatorMapping ClassTraineeMappingEntry;
        //    //               if (!ClassTraineeMappingDictionary.TryGetValue(loginUsers.ID, out ClassTraineeMappingEntry))
        //    //               {
        //    //                   ClassTraineeMappingEntry = loginUsers;
        //    //                   ClassTraineeMappingEntry.Person = new List<Person>();
        //    //                   ClassTraineeMappingDictionary.Add(ClassTraineeMappingEntry.ID, ClassTraineeMappingEntry);
        //    //               }
        //    //               if (person != null)
        //    //                   ClassTraineeMappingEntry.Person.Add(person);
        //    //               return ClassTraineeMappingEntry;
        //    //           }, param, commandType: System.Data.CommandType.StoredProcedure,
        //    //           splitOn: "CoordinateIDs")
        //    //       .Distinct()
        //    //       .ToList();
        //    //    conn.Close();
        //    //}
        //    //LoginUserList.FirstOrDefault().DisplayName = LoginUserList.FirstOrDefault().Person.FirstOrDefault().P_DisplayName;
        //    //return LoginUserList;


        //    List<CourseCoordinatorMapping> LoginUserList = new List<CourseCoordinatorMapping>();
        //    var conString = DBHelper.ConnectionString;
        //    using (var conn = new SqlConnection(conString))
        //    {
        //        conn.Open();
        //        string qry = @"TMS_CourseCoordinator_GetAll";
        //        DynamicParameters param = new DynamicParameters();
        //        param.Add("@CourseID", CourseId);
        //        var LoginUsersDictionary = new Dictionary<long, CourseCoordinatorMapping>();
        //        LoginUserList = conn.Query<CourseCoordinatorMapping, Person, CourseCoordinatorMapping>(
        //               qry, (loginUsers, Groups) =>
        //               {
        //                   CourseCoordinatorMapping loginUsersEntry;
        //                   if (!LoginUsersDictionary.TryGetValue(loginUsers.ID, out loginUsersEntry))
        //                   {
        //                       loginUsersEntry = loginUsers;
        //                       loginUsersEntry.Person = new List<Person>();
        //                       LoginUsersDictionary.Add(loginUsersEntry.ID, loginUsersEntry);
        //                   }
        //                   if (Groups != null)
        //                       loginUsersEntry.Person.Add(Groups);
        //                   return loginUsersEntry;
        //               }, param, commandType: System.Data.CommandType.StoredProcedure,
        //               splitOn: "ID")
        //           .Distinct()
        //           .ToList();
        //        conn.Close();
        //    }
        //    LoginUserList.FirstOrDefault().DisplayName = LoginUserList.FirstOrDefault().Person.FirstOrDefault().P_DisplayName;
        //    return LoginUserList;
        //}

        public long TMS_CourseCoordinate_CreateDAL(CourseCoordinatorMapping _Coordinate, long CourseId)
        {
            var parameters = new[] { ParamBuilder.Par("ID", 0) };

            return(ExecuteInt64withOutPutparameterSp("TMS_CourseCoordinator_Create", parameters,
                                                     ParamBuilder.Par("CoordinateID", _Coordinate.CoordinateID),
                                                     ParamBuilder.Par("CourseID", CourseId),
                                                     ParamBuilder.Par("CreatedBy", _Coordinate.CreatedBy),
                                                     ParamBuilder.Par("CreatedDate", _Coordinate.CreatedDate)));
        }
Ejemplo n.º 3
0
 public int TMS_CourseCoordinate_DeleteDAL(CourseCoordinatorMapping _Coordinate, long CourseId)
 {
     return(_CourseDAL.TMS_CourseCoordinate_DeleteDAL(_Coordinate, CourseId));
 }
Ejemplo n.º 4
0
 public long TMS_CourseCoordinate_CreateBAL(CourseCoordinatorMapping _Coordinate, long CourseId)
 {
     return(_CourseDAL.TMS_CourseCoordinate_CreateDAL(_Coordinate, CourseId));
 }