public Core.Business.OperateSort Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectOperateSort");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.OperateSort operateSort = new Core.Business.OperateSort();

                if (!reader.IsDBNull(0)) operateSort.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) operateSort.OperateSortName = reader.GetString(1);

                reader.Close();
                return operateSort;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Example #2
0
        public IList<Core.Business.Asset> GetAllAsset()
        {
            IList<Core.Business.Asset> assetlist = new List<Core.Business.Asset>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllAsset);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Asset asset = new Core.Business.Asset();

                    if (!reader.IsDBNull(0)) asset.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) asset.AssetType = reader.GetString(1);
                    if (!reader.IsDBNull(2)) asset.AssetItemName = reader.GetString(2);
                    if (!reader.IsDBNull(3)) asset.UnitValue = reader.GetDecimal(3);
                    if (!reader.IsDBNull(4)) asset.PurchasingDate = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) asset.RegisterDate = reader.GetDateTime(5);
                    if (!reader.IsDBNull(6)) asset.Num = reader.GetInt32(6);
                    if (!reader.IsDBNull(7)) asset.TotalValue = reader.GetDecimal(7);

                    asset.MarkOld();
                    assetlist.Add(asset);
                }
                reader.Close();
            }
            return assetlist;
        }
        public void Delete(Core.Business.OperateSort operateSort)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, operateSort.Id);
            sql.ExecuteSP("usp_DeleteOperateSort");
        }
        public IList<Core.Business.InstrumentPictureRepository> GetAllInstrumentPictureRepository()
        {
            IList<Core.Business.InstrumentPictureRepository> instrumentPictureRepositorylist = new List<Core.Business.InstrumentPictureRepository>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectInstrumentPictureRepositoriesAll");

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.InstrumentPictureRepository instrumentPictureRepository = new Core.Business.InstrumentPictureRepository();

                    if (!reader.IsDBNull(0)) instrumentPictureRepository.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) instrumentPictureRepository.PictureName = reader.GetString(1);
                    if (!reader.IsDBNull(2)) instrumentPictureRepository.InstrumentID = reader.GetGuid(2);
                    if (!reader.IsDBNull(3)) instrumentPictureRepository.PictureSortID = reader.GetGuid(3);
                    if (!reader.IsDBNull(4)) instrumentPictureRepository.PictureOrigin = reader.GetString(4);
                    if (!reader.IsDBNull(5)) instrumentPictureRepository.PictureContent = reader.GetString(5);
                    if (!reader.IsDBNull(6)) instrumentPictureRepository.Remark = reader.GetString(6);
                    if (!reader.IsDBNull(7)) instrumentPictureRepository.DranscriberID = reader.GetGuid(7);
                    if (!reader.IsDBNull(8)) instrumentPictureRepository.DranscribeDate = reader.GetDateTime(8);

                    instrumentPictureRepository.MarkOld();
                    instrumentPictureRepositorylist.Add(instrumentPictureRepository);
                }
                reader.Close();
            }
            return instrumentPictureRepositorylist;
        }
Example #5
0
        public Core.Business.StudentPass GetPassByStdID(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();
            string sqlwhere = "SELECT [ID], [StuID],[Pass] from [StudentPass] where StuID="+id+"";
            SqlDataReader reader = sql.ExecuteSqlReader(sqlwhere);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.StudentPass studentPass = new Core.Business.StudentPass();

                if (!reader.IsDBNull(0)) studentPass.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) studentPass.StuID = reader.GetInt32(1);
                if (!reader.IsDBNull(2)) studentPass.Pass = reader.GetString(2);

                reader.Close();
                return studentPass;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
        public int GetCommentCountByMiniBlogId(CY.UME.Core.Business.MiniBlog miniBlog)
        {
            int count = 0;

            if (miniBlog == null)
            {
                return count;
            }

            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@MiniBlogId", SqlDbType.BigInt, miniBlog.Id);
            SqlDataReader reader = sql.ExecuteSPReader("USP_MiniBlogComment_SelectCount_By_MiniBlogId");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }

            return count;
        }
        public Core.Business.ObjectStimulatedType Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectObjectStimulatedType");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.ObjectStimulatedType objectStimulatedType = new Core.Business.ObjectStimulatedType();

                if (!reader.IsDBNull(0)) objectStimulatedType.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) objectStimulatedType.Name = reader.GetString(1);
                if (!reader.IsDBNull(2)) objectStimulatedType.Description = reader.GetString(2);

                reader.Close();
                return objectStimulatedType;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Example #8
0
        public Core.Business.Annex Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@ID", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectAnnex");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.Annex annex = new Core.Business.Annex();

                if (!reader.IsDBNull(0)) annex.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) annex.AnnexTypeID = reader.GetGuid(1);
                if (!reader.IsDBNull(2)) annex.ContentType = reader.GetInt32(2);
                if (!reader.IsDBNull(3)) annex.ContentID = reader.GetGuid(3);
                if (!reader.IsDBNull(4)) annex.Name = reader.GetString(4);
                if (!reader.IsDBNull(5)) annex.AnnexURI = reader.GetString(5);

                reader.Close();
                return annex;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Example #9
0
        public void Delete(Core.Business.ControlPermissions2 controlPermissions2)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, controlPermissions2.Id);
            sql.ExecuteSql(SqlDeleteControlPermissions2);
        }
Example #10
0
        public Core.Business.SysSetting Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSysSetting");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.SysSetting sysSetting = new Core.Business.SysSetting();

                if (!reader.IsDBNull(0)) sysSetting.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) sysSetting.Name = reader.GetString(1);
                if (!reader.IsDBNull(2)) sysSetting.SysValue = reader.GetString(2);

                reader.Close();
                return sysSetting;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Example #11
0
        public void Delete(Core.Business.SysSetting sysSetting)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, sysSetting.Id);
            sql.ExecuteSP("usp_DeleteSysSetting");
        }
Example #12
0
        public Core.Business.Subsidies Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSubsidy");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.Subsidies subsidies = new Core.Business.Subsidies();

                if (!reader.IsDBNull(0)) subsidies.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) subsidies.Name = reader.GetString(1);
                if (!reader.IsDBNull(2)) subsidies.Des = reader.GetString(2);
                if (!reader.IsDBNull(3)) subsidies.AddPerson = reader.GetString(3);
                if (!reader.IsDBNull(4)) subsidies.AddTime = reader.GetDateTime(4);
                if (!reader.IsDBNull(5)) subsidies.Status = reader.GetInt32(5);

                reader.Close();
                return subsidies;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
Example #13
0
        public IList<Core.Business.Subsidies> GetAllSubsidies()
        {
            IList<Core.Business.Subsidies> subsidieslist = new List<Core.Business.Subsidies>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSubsidiesAll");

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.Subsidies subsidies = new Core.Business.Subsidies();

                    if (!reader.IsDBNull(0)) subsidies.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) subsidies.Name = reader.GetString(1);
                    if (!reader.IsDBNull(2)) subsidies.Des = reader.GetString(2);
                    if (!reader.IsDBNull(3)) subsidies.AddPerson = reader.GetString(3);
                    if (!reader.IsDBNull(4)) subsidies.AddTime = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) subsidies.Status = reader.GetInt32(5);

                    subsidies.MarkOld();
                    subsidieslist.Add(subsidies);
                }
                reader.Close();
            }
            return subsidieslist;
        }
Example #14
0
        public void Delete(Core.Business.Subsidies subsidies)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, subsidies.Id);
            sql.ExecuteSP("usp_DeleteSubsidy");
        }
Example #15
0
        public void Insert(Core.Business.Asset asset)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@AssetType", SqlDbType.NVarChar, asset.AssetType);
            sql.AddParameter("@AssetItemName", SqlDbType.NVarChar, asset.AssetItemName);
            sql.AddParameter("@UnitValue", SqlDbType.Decimal, asset.UnitValue);
            sql.AddParameter("@PurchasingDate", SqlDbType.DateTime, asset.PurchasingDate);
            sql.AddParameter("@RegisterDate", SqlDbType.DateTime, asset.RegisterDate);
            sql.AddParameter("@Num", SqlDbType.Int, asset.Num);

            SqlDataReader reader = sql.ExecuteSqlReader(SqlInsertAsset);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) asset.Id = int.Parse(reader.GetDecimal(0).ToString());

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
Example #16
0
        public void Delete(Core.Business.Annex annex)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@ID", SqlDbType.UniqueIdentifier, annex.Id);
            sql.ExecuteSP("usp_DeleteAnnex");
        }
Example #17
0
        public IList<Core.Business.Annex> GetAllAnnex()
        {
            IList<Core.Business.Annex> annexlist = new List<Core.Business.Annex>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectAnnicesAll");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Annex annex = new Core.Business.Annex();

                    if (!reader.IsDBNull(0)) annex.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) annex.AnnexTypeID = reader.GetGuid(1);
                    if (!reader.IsDBNull(2)) annex.ContentType = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) annex.ContentID = reader.GetGuid(3);
                    if (!reader.IsDBNull(4)) annex.Name = reader.GetString(4);
                    if (!reader.IsDBNull(5)) annex.AnnexURI = reader.GetString(5);

                    annex.MarkOld();
                    annexlist.Add(annex);
                }
                reader.Close();
            }
            return annexlist;
        }
Example #18
0
        public Core.Business.ControlPermissions2 Select(int id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectControlPermissions2);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.ControlPermissions2 controlPermissions2 = new Core.Business.ControlPermissions2();

                if (!reader.IsDBNull(0)) controlPermissions2.Id = reader.GetInt32(0);
                if (!reader.IsDBNull(1)) controlPermissions2.ControlKey = reader.GetInt32(1);
                if (!reader.IsDBNull(2)) controlPermissions2.PermissionsKey = reader.GetInt32(2);

                reader.Close();
                return controlPermissions2;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
        public void Delete(Core.Business.ObjectStimulatedType objectStimulatedType)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, objectStimulatedType.Id);
            sql.ExecuteSP("usp_DeleteObjectStimulatedType");
        }
        public void Delete(Core.Business.FavoritesComment favoritesComment)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, favoritesComment.Id);
            sql.ExecuteSqlReader(SqlDeleteFavoritesComment);
        }
        public void Delete(Core.Business.MiniBlogComment miniBlogComment)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, miniBlogComment.Id);
            sql.ExecuteSP("USP_MiniBlogComment_Delete_By_Id");
        }
        public int GetCommentCountByFavoritesId(CY.UME.Core.Business.Favorites favorites)
        {
            int count = 0;

            if (favorites == null)
            {
                return count;
            }

            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@FavoritesId", SqlDbType.BigInt, favorites.Id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetFavoritesCommentCountByInstanceId);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }

            return count;
        }
Example #23
0
        public void Delete(Core.Business.StudentPass studentPass)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@ID", SqlDbType.Int, studentPass.Id);
            sql.ExecuteSql(SqlDeleteStudentPass);
        }
Example #24
0
        public void Delete(Core.Business.Messages messages)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, messages.Id);
            sql.ExecuteSql(SqlDeleteMessages);
        }
        public void Delete(Core.Business.InstrumentPictureRepository instrumentPictureRepository)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, instrumentPictureRepository.Id);
            sql.ExecuteSP("usp_DeleteInstrumentPictureRepository");
        }
Example #26
0
        public IList<Core.Business.Messages> GetAllMessages()
        {
            IList<Core.Business.Messages> messageslist = new List<Core.Business.Messages>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllMessages);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Messages messages = new Core.Business.Messages();

                    if (!reader.IsDBNull(0)) messages.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) messages.Content = reader.GetString(1);
                    if (!reader.IsDBNull(2)) messages.Type = reader.GetInt32(2);
                    if (!reader.IsDBNull(3)) messages.DateCreated = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) messages.SendDate = reader.GetDateTime(4);
                    if (!reader.IsDBNull(5)) messages.IsRead = reader.GetInt32(5);
                    if (!reader.IsDBNull(6)) messages.AuthorId = reader.GetInt64(6);
                    if (!reader.IsDBNull(7)) messages.AccountId = reader.GetInt64(7);
                    if (!reader.IsDBNull(8)) messages.Title = reader.GetString(8);
                    if (!reader.IsDBNull(9)) messages.Attachments = reader.GetString(9);
                    if (!reader.IsDBNull(10)) messages.AuthorName = reader.GetString(10);
                    if (!reader.IsDBNull(11)) messages.AccountName = reader.GetString(11);

                    messages.MarkOld();
                    messageslist.Add(messages);
                }
                reader.Close();
            }
            return messageslist;
        }
        public int getCount(string strWhere)
        {
            SqlServerUtility sql = new SqlServerUtility();

            if (strWhere.Trim().Equals(""))
            {
                strWhere = "1=1";
            }
            string sqlstr = "select count(*) from InstrumentPictureRepository where " + strWhere + "";
            SqlDataReader reader = sql.ExecuteSqlReader(sqlstr);

            int count = 0;
            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) count = reader.GetInt32(0);

                reader.Close();
                return count;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();
                return count;
            }
        }
Example #28
0
        public void Delete(Core.Business.TRGroup tRGroup)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, tRGroup.Id);
            sql.ExecuteSql(SqlDeleteTRGroup);
        }
Example #29
0
        public IList<Core.Business.TRGroup> GetAllTRGroup()
        {
            IList<Core.Business.TRGroup> tRGrouplist = new List<Core.Business.TRGroup>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllTRGroup);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.TRGroup tRGroup = new Core.Business.TRGroup();

                    if (!reader.IsDBNull(0)) tRGroup.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) tRGroup.TrGroupCode = reader.GetString(1);
                    if (!reader.IsDBNull(2)) tRGroup.TrGoupName = reader.GetString(2);
                    if (!reader.IsDBNull(3)) tRGroup.AddDate = reader.GetDateTime(3);
                    if (!reader.IsDBNull(4)) tRGroup.BuildDate = reader.GetDateTime(4);

                    tRGroup.MarkOld();
                    tRGrouplist.Add(tRGroup);
                }
                reader.Close();
            }
            return tRGrouplist;
        }
Example #30
0
        public void Delete(Core.Business.Asset asset)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.Int, asset.Id);
            sql.ExecuteSql(SqlDeleteAsset);
        }