Exemplo n.º 1
0
        private static T_COM_Master_Degree GetItemFromReader(IDataReader dataReader)
        {
            T_COM_Master_Degree objItem = new T_COM_Master_Degree();

            objItem.DegreeID = SqlHelper.GetInt(dataReader, "DegreeID");

            objItem.Degree = SqlHelper.GetString(dataReader, "Degree");

            objItem.DegreeVN = SqlHelper.GetString(dataReader, "DegreeVN");

            objItem.CreatedBy = SqlHelper.GetInt(dataReader, "CreatedBy");

            objItem.CreatedDate = SqlHelper.GetDateTime(dataReader, "CreatedDate");

            objItem.ModifiedBy = SqlHelper.GetInt(dataReader, "ModifiedBy");

            objItem.ModifiedDate = SqlHelper.GetDateTime(dataReader, "ModifiedDate");

            objItem.IsActive = SqlHelper.GetBoolean(dataReader, "IsActive");



            if (SqlHelper.ColumnExists(dataReader, "TotalRecord"))
            {
                objItem.TotalRecord = SqlHelper.GetInt(dataReader, "TotalRecord");
            }
            return(objItem);
        }
Exemplo n.º 2
0
        public static T_COM_Master_Degree UpdateItem(T_COM_Master_Degree model)
        {
            int result = 0;

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, CommandType.StoredProcedure, "T_COM_Master_Degree_Update", CreateSqlParameter(model)))
            {
                while (reader.Read())
                {
                    result = (int)reader[0];
                }
            }
            return(GetItemByID(result));
        }
Exemplo n.º 3
0
 private static SqlParameter[] CreateSqlParameter(T_COM_Master_Degree model)
 {
     return(new SqlParameter[]
     {
         new SqlParameter("@DegreeID", model.DegreeID),
         new SqlParameter("@Degree", model.Degree),
         new SqlParameter("@DegreeVN", model.DegreeVN),
         new SqlParameter("@CreatedBy", model.CreatedBy),
         new SqlParameter("@CreatedDate", model.CreatedDate),
         new SqlParameter("@ModifiedBy", model.ModifiedBy),
         new SqlParameter("@ModifiedDate", model.ModifiedDate),
         new SqlParameter("@IsActive", model.IsActive),
     });
 }
Exemplo n.º 4
0
        public static T_COM_Master_Degree GetItemByID(int DegreeID)
        {
            T_COM_Master_Degree item = new T_COM_Master_Degree();
            var sqlParams            = new SqlParameter[1];

            sqlParams[0] = new SqlParameter("@DegreeID", DegreeID);
            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Degree_GetByID", sqlParams))
            {
                while (reader.Read())
                {
                    item = GetItemFromReader(reader);
                }
            }
            return(item);
        }
Exemplo n.º 5
0
        public static T_COM_Master_DegreeCollection Search(SearchFilter SearchKey)
        {
            T_COM_Master_DegreeCollection collection = new T_COM_Master_DegreeCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Degree_Search", SearchFilterManager.SqlSearchParamNoCompany(SearchKey)))
            {
                while (reader.Read())
                {
                    T_COM_Master_Degree obj = new T_COM_Master_Degree();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Exemplo n.º 6
0
        public static T_COM_Master_DegreeCollection GetAllItem()
        {
            T_COM_Master_DegreeCollection collection = new T_COM_Master_DegreeCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_COM_Master_Degree_GetAll", null))
            {
                while (reader.Read())
                {
                    T_COM_Master_Degree obj = new T_COM_Master_Degree();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }