public void Update(DataTypeContent myEntity)
        {
            SQLDAHelper SqlHelper = new SQLDAHelper();
            SqlConnection conn = SqlHelper.GetConnection(false);

            SqlHelper.AddInParameter("@data_type_content_id", SqlDbType.Int,myEntity.DataTypeContentId);

            SqlHelper.AddInParameter("@data_type_content", SqlDbType.NVarChar, myEntity.DataTypeContents);
            SqlHelper.AddInParameter("@data_type_content_ar", SqlDbType.NVarChar, myEntity.DataTypeContentAr);
            SqlHelper.AddInParameter("@data_type_id", SqlDbType.Int, myEntity.DataTypeId);
            SqlHelper.AddInParameter("@updated_by", SqlDbType.Int, myEntity.UpdatedBy);
            SqlHelper.ExecuteNonQuery("dbo.SP_DataTypeContent_Update", conn, false);
        }
        public void Add(DataTypeContent myEntity)
        {
            SQLDAHelper SqlHelper = new SQLDAHelper();
            SqlConnection conn = SqlHelper.GetConnection(false);

            SqlHelper.AddOutParameter("@data_type_content_id", SqlDbType.Int);

            SqlHelper.AddInParameter("@data_type_content", SqlDbType.NVarChar,myEntity.DataTypeContents );
            SqlHelper.AddInParameter("@data_type_content_ar", SqlDbType.NVarChar, myEntity.DataTypeContentAr);
            SqlHelper.AddInParameter("@data_type_id", SqlDbType.Int, myEntity.DataTypeId);
            SqlHelper.AddInParameter("@created_by", SqlDbType.Int, myEntity.CreatedBy);
            SqlHelper.ExecuteNonQuery("dbo.SP_DataTypeContent_Add", conn, false);

            myEntity.DataTypeContentId = (int)SqlHelper.GetOutParameterValue("@data_type_content_id");
        }
示例#3
0
        public List<E.Entity> FindAll()
        {
            List<E.Entity> list = new List<E.Entity>();
            SQLDAHelper sqlHelper = new SQLDAHelper();

            SqlConnection conn = sqlHelper.GetConnection(false);

            SqlDataReader reder = sqlHelper.ExcuteReader("dbo.SP_Entity_FindAll", conn);

            if (reder != null && reder.HasRows)
            {
                while (reder.Read())
                {
                    list.Add(Mapper.GetMapper(reder));
                }
                reder.Close();
                return list;
            }
            else
                return null;
        }