public void Insert(Core.Business.SubsidyRecordForStudent subsidyRecordForStudent) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@AcidLevel", SqlDbType.TinyInt, subsidyRecordForStudent.AcidLevel); sql.AddParameter("@CheckState", SqlDbType.TinyInt, subsidyRecordForStudent.CheckState); sql.AddParameter("@SubsidyID", SqlDbType.Int, subsidyRecordForStudent.SubsidyID); sql.AddParameter("@Year", SqlDbType.Int, subsidyRecordForStudent.Year); sql.AddParameter("@Term", SqlDbType.Int, subsidyRecordForStudent.Term); sql.AddParameter("@Date", SqlDbType.DateTime, subsidyRecordForStudent.Date); sql.AddParameter("@Amount", SqlDbType.Decimal, subsidyRecordForStudent.Amount); sql.AddParameter("@Receiver", SqlDbType.NVarChar, subsidyRecordForStudent.Receiver); sql.AddParameter("@Description", SqlDbType.NVarChar, subsidyRecordForStudent.Description); sql.AddParameter("@DiffcultReason", SqlDbType.NVarChar, subsidyRecordForStudent.DiffcultReason); sql.AddParameter("@FamiliesType", SqlDbType.NVarChar, subsidyRecordForStudent.FamiliesType); sql.AddParameter("@HelpReason", SqlDbType.NVarChar, subsidyRecordForStudent.HelpReason); sql.AddParameter("@ClassView", SqlDbType.NVarChar, subsidyRecordForStudent.ClassView); sql.AddParameter("@SchoolView", SqlDbType.NVarChar, subsidyRecordForStudent.SchoolView); SqlDataReader reader = sql.ExecuteSqlReader(SqlInsertSubsidyRecordForStudent); if (reader != null && !reader.IsClosed && reader.Read()) { if (!reader.IsDBNull(0)) subsidyRecordForStudent.Id = int.Parse(reader.GetDecimal(0).ToString()); reader.Close(); } else { if (reader != null && !reader.IsClosed) reader.Close(); } }
public void Insert(Core.Business.TeachReachRcd teachReachRcd) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@TRCode", SqlDbType.NVarChar, teachReachRcd.TRCode); sql.AddParameter("@StartTime", SqlDbType.DateTime, teachReachRcd.StartTime); sql.AddParameter("@EndTime", SqlDbType.DateTime, teachReachRcd.EndTime); sql.AddParameter("@ConsistTime", SqlDbType.DateTime, teachReachRcd.ConsistTime); sql.AddParameter("@Partners", SqlDbType.NVarChar, teachReachRcd.Partners); sql.AddParameter("@Subject", SqlDbType.NVarChar, teachReachRcd.Subject); sql.AddParameter("@Des", SqlDbType.NVarChar, teachReachRcd.Des); sql.AddParameter("@AttachmentCode", SqlDbType.NVarChar, teachReachRcd.AttachmentCode); sql.AddParameter("@YearNum", SqlDbType.NVarChar, teachReachRcd.YearNum); sql.AddParameter("@Term", SqlDbType.Int, teachReachRcd.Term); SqlDataReader reader = sql.ExecuteSqlReader(SqlInsertTeachReachRcd); if (reader != null && !reader.IsClosed && reader.Read()) { if (!reader.IsDBNull(0)) teachReachRcd.Id = int.Parse(reader.GetDecimal(0).ToString()); reader.Close(); } else { if (reader != null && !reader.IsClosed) reader.Close(); } }
public IList<CY.GFive.Core.Business.VoteRecordDetail> GetVoteRecordDetailByItemAndAnswer(int ItemID, int AnswerID) { IList<Core.Business.VoteRecordDetail> voteRecordDetaillist = new List<Core.Business.VoteRecordDetail>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@voteItemID", SqlDbType.Int, ItemID); sql.AddParameter("@voteAnswerID", SqlDbType.Int, AnswerID); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetVoteRecordDetailByItemAndAnswer); if (reader != null) { while (reader.Read()) { Core.Business.VoteRecordDetail voteRecordDetail = new Core.Business.VoteRecordDetail(); if (!reader.IsDBNull(0)) voteRecordDetail.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) voteRecordDetail.VoteRecordID = reader.GetInt32(1); if (!reader.IsDBNull(2)) voteRecordDetail.VoteItemID = reader.GetInt32(2); if (!reader.IsDBNull(3)) voteRecordDetail.VoteAnswerID = reader.GetInt32(3); voteRecordDetail.MarkOld(); voteRecordDetaillist.Add(voteRecordDetail); } reader.Close(); } return voteRecordDetaillist; }
public Core.Business.RoleOperation Select(RoleOperationKey id) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@OperationId", SqlDbType.Int, id.OperationId); sql.AddParameter("@RoleId", SqlDbType.Int, id.RoleId); SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectRoleOperation); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.RoleOperation roleOperation = new Core.Business.RoleOperation(); roleOperation.Id = new Core.Business.RoleOperationKey(); if (!reader.IsDBNull(0)) roleOperation.Id.OperationId = reader.GetInt32(0); if (!reader.IsDBNull(1)) roleOperation.Id.RoleId = reader.GetInt32(1); if (!reader.IsDBNull(2)) roleOperation.Status = reader.GetInt32(2); if (!reader.IsDBNull(3)) roleOperation.AddDate = reader.GetDateTime(3); reader.Close(); return roleOperation; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }
public IList<CY.CSTS.Core.Business.INSTRATTACHMENT> GetInstrattachmentDynamic(string whereCondition, string orderByExpression) { IList<Core.Business.INSTRATTACHMENT> iNSTRATTACHMENTlist = new List<Core.Business.INSTRATTACHMENT>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, whereCondition); sql.AddParameter("@OrderByExpression", SqlDbType.NVarChar, orderByExpression); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectINSTRATTACHMENTsDynamic"); if (reader != null) { while (reader.Read()) { Core.Business.INSTRATTACHMENT iNSTRATTACHMENT = new Core.Business.INSTRATTACHMENT(); if (!reader.IsDBNull(0)) iNSTRATTACHMENT.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) iNSTRATTACHMENT.InstruId = reader.GetGuid(1); if (!reader.IsDBNull(2)) iNSTRATTACHMENT.ATTACHMENTNAME = reader.GetString(2); if (!reader.IsDBNull(3)) iNSTRATTACHMENT.ATTACHMENTAMOUNT = reader.GetInt32(3); if (!reader.IsDBNull(4)) iNSTRATTACHMENT.ATTACHMENTSPEC = reader.GetString(4); if (!reader.IsDBNull(5)) iNSTRATTACHMENT.ATTACHMENTPRICE = reader.GetDecimal(5); if (!reader.IsDBNull(6)) iNSTRATTACHMENT.PURPOSE = reader.GetString(6); if (!reader.IsDBNull(7)) iNSTRATTACHMENT.MANUFACTURER = reader.GetString(7); if (!reader.IsDBNull(8)) iNSTRATTACHMENT.REMARK = reader.GetString(8); if (!reader.IsDBNull(9)) iNSTRATTACHMENT.WRITEDATE = reader.GetDateTime(9); if (!reader.IsDBNull(10)) iNSTRATTACHMENT.UPDATEDATE = reader.GetDateTime(10); iNSTRATTACHMENT.MarkOld(); iNSTRATTACHMENTlist.Add(iNSTRATTACHMENT); } reader.Close(); } return iNSTRATTACHMENTlist; }
public int GetAvailableNum(DateTime ArriveTime, DateTime LeftTime, string RoomCate) { SqlServerUtility db = new SqlServerUtility(); db.AddParameter("@ArriveTime", SqlDbType.DateTime, ArriveTime); db.AddParameter("@LeftTime", SqlDbType.DateTime, LeftTime); db.AddParameter("@RoomCate", SqlDbType.VarChar, RoomCate); SqlDataReader rdr = db.ExecuteSqlReader(SQLGetRoomNum); if (rdr != null) { if (!rdr.IsClosed) { int Num = 0; if (rdr.Read()) { if (!rdr.IsDBNull(0)) Num = rdr.GetInt32(0); rdr.Close(); return Num; } } } return 0; }
public void Add(CY.HotelBooking.Core.Business.Web_News n) { SqlServerUtility sqlhelper = new SqlServerUtility(); sqlhelper.AddParameter("@News_Title", SqlDbType.VarChar, n.News_Title, 100); sqlhelper.AddParameter("@News_Content", SqlDbType.Text, n.News_Content); sqlhelper.AddParameter("@News_PubDate", SqlDbType.DateTime, n.News_PubDate); sqlhelper.AddParameter("@Module_Code", SqlDbType.VarChar, n.Module_Code, 10); sqlhelper.AddParameter("@Manager_Code", SqlDbType.VarChar, n.Manager_Code, 10); SqlDataReader reader = sqlhelper.ExecuteSqlReader(strSQLInsert); if (reader != null && !reader.IsClosed && reader.Read()) { if (!reader.IsDBNull(0)) { int id; if (int.TryParse(reader.GetValue(0).ToString(), out id)) { n.Id = id; } } reader.Close(); } else { if (reader != null && !reader.IsClosed) reader.Close(); } }
public IList<Question> GetSqlWhere(string sqlwhere) { IList<Core.Business.Question> questionlist = new List<Core.Business.Question>(); SqlServerUtility sql = new SqlServerUtility(); StringBuilder sbOrderExpression = new StringBuilder(); sbOrderExpression.Append(string.Format("CreateDate desc")); sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, sqlwhere); sql.AddParameter("@OrderByExpression", SqlDbType.NVarChar, sbOrderExpression.ToString()); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectQuestionsDynamic"); if (reader != null) { while (reader.Read()) { Core.Business.Question question = new Core.Business.Question(); if (!reader.IsDBNull(0)) question.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) question.Title = reader.GetString(1); if (!reader.IsDBNull(2)) question.Content = reader.GetString(2); if (!reader.IsDBNull(3)) question.UserID = reader.GetGuid(3); if (!reader.IsDBNull(4)) question.CreateDate = reader.GetDateTime(4); if (!reader.IsDBNull(5)) question.IsHomePage = reader.GetInt32(5); question.MarkOld(); questionlist.Add(question); } reader.Close(); } return questionlist; }
public void Insert(Core.Business.JointReview jointReview) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@InstrumentName", SqlDbType.NVarChar, jointReview.InstrumentName); sql.AddParameter("@ApplicationUint", SqlDbType.NVarChar, jointReview.ApplicationUint); sql.AddParameter("@ApplicationUintID", SqlDbType.UniqueIdentifier, jointReview.ApplicationUintID); sql.AddParameter("@Corporate", SqlDbType.NVarChar, jointReview.Corporate); sql.AddParameter("@ApplicaitionPerson", SqlDbType.UniqueIdentifier, jointReview.ApplicaitionPerson); sql.AddParameter("@ApplicationTime", SqlDbType.DateTime, jointReview.ApplicationTime); sql.AddParameter("@CreateTime", SqlDbType.DateTime, jointReview.CreateTime); sql.AddParameter("@Status", SqlDbType.Int, jointReview.Status); sql.AddParameter("@ApplicationDes", SqlDbType.NVarChar, jointReview.ApplicationDes); sql.AddParameter("@AuditDes", SqlDbType.NVarChar, jointReview.AuditDes); sql.AddOutputParameter("@Id", SqlDbType.UniqueIdentifier); SqlDataReader reader = sql.ExecuteSPReader("usp_InsertJointReview"); if (reader != null && !reader.IsClosed && reader.Read()) { if (!reader.IsDBNull(0)) jointReview.Id = reader.GetGuid(0); reader.Close(); } else { if (reader != null && !reader.IsClosed) reader.Close(); } }
public TClassInfo GetByParam(string classCode, string TclsCode) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@ClassCode", SqlDbType.NVarChar, classCode); sql.AddParameter("@TClsCode", SqlDbType.NVarChar, TclsCode); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetByParam); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.TClassInfo tClassInfo = new Core.Business.TClassInfo(); if (!reader.IsDBNull(0)) tClassInfo.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) tClassInfo.ClassCode = reader.GetString(1); if (!reader.IsDBNull(2)) tClassInfo.TClsCode = reader.GetString(2); tClassInfo.MarkOld(); reader.Close(); return tClassInfo; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }
public void Insert(Core.Business.SubCenterSetting subCenterSetting) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@UintID", SqlDbType.UniqueIdentifier, subCenterSetting.UintID); sql.AddParameter("@Name", SqlDbType.NVarChar, subCenterSetting.Name); sql.AddParameter("@URI", SqlDbType.NVarChar, subCenterSetting.URI); sql.AddParameter("@Themes", SqlDbType.NVarChar, subCenterSetting.Themes); sql.AddParameter("@User", SqlDbType.UniqueIdentifier, subCenterSetting.User); sql.AddParameter("@Contact", SqlDbType.NVarChar, subCenterSetting.Contact); sql.AddParameter("@Des", SqlDbType.NVarChar, subCenterSetting.Des); sql.AddOutputParameter("@Id", SqlDbType.UniqueIdentifier); SqlDataReader reader = sql.ExecuteSPReader("usp_InsertSubCenterSetting"); if (reader != null && !reader.IsClosed && reader.Read()) { if (!reader.IsDBNull(0)) subCenterSetting.Id = reader.GetGuid(0); reader.Close(); } else { if (reader != null && !reader.IsClosed) reader.Close(); } }
public IList<Core.Business.College> GetCollegeByUniIdAndName(int uniId, string name) { IList<Core.Business.College> collegelist = new List<Core.Business.College>(); SqlServerUtility sql = new SqlServerUtility(SqlConnectionString); sql.AddParameter("@UniversityId", SqlDbType.Int, uniId); sql.AddParameter("@Name", SqlDbType.Int, name); SqlDataReader reader = sql.ExecuteSPReader("USP_College_Select_By_UniId_And_Name"); if (reader != null) { while (reader.Read()) { Core.Business.College college = new Core.Business.College(); if (!reader.IsDBNull(0)) college.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) college.UniversityID = reader.GetInt32(1); if (!reader.IsDBNull(2)) college.DateCreated = reader.GetDateTime(2); if (!reader.IsDBNull(3)) college.Name = reader.GetString(3); if (!reader.IsDBNull(4)) college.Des = reader.GetString(4); college.MarkOld(); collegelist.Add(college); } reader.Close(); } return collegelist; }
public IList<Core.Business.Major> GetMajorByColIdAndName(int colId, string name) { IList<Core.Business.Major> majorlist = new List<Core.Business.Major>(); SqlServerUtility sql = new SqlServerUtility(SqlConnectionString); sql.AddParameter("@CollegeId", SqlDbType.Int, colId); sql.AddParameter("@Name", SqlDbType.NVarChar, name); SqlDataReader reader = sql.ExecuteSPReader("USP_Major_Select_By_ColId_And_Name"); if (reader != null) { while (reader.Read()) { Core.Business.Major major = new Core.Business.Major(); if (!reader.IsDBNull(0)) major.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) major.CollegeID = reader.GetInt32(1); if (!reader.IsDBNull(2)) major.Name = reader.GetString(2); if (!reader.IsDBNull(3)) major.Des = reader.GetString(3); major.MarkOld(); majorlist.Add(major); } reader.Close(); } return majorlist; }
/// <summary> /// ���ݻID��������ID����������ID�ж�ij�����Ƿ��Ѿ���ij����� /// </summary> /// <param name="AccountID"></param> /// <param name="InviteID"></param> /// <param name="ActiveitesID"></param> /// <returns></returns> public IList<ActivitiesInvite> Get(long AccountID, long InviteID, int ActiveitesID) { IList<Core.Business.ActivitiesInvite> activitiesInvitelist = new List<Core.Business.ActivitiesInvite>(); SqlServerUtility sql = new SqlServerUtility(connectionString); string sqlwhere = "AccountID=" + AccountID + " and InviteID=" + InviteID + " and ActiveitesID=" + ActiveitesID + ""; sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, sqlwhere); sql.AddParameter("@OrderByExpression",SqlDbType.NVarChar,"InviteaTime desc"); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectActivitiesInvitesDynamic"); if (reader != null) { while (reader.Read()) { Core.Business.ActivitiesInvite activitiesInvite = new Core.Business.ActivitiesInvite(); if (!reader.IsDBNull(0)) activitiesInvite.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) activitiesInvite.AccountID = reader.GetInt64(1); if (!reader.IsDBNull(2)) activitiesInvite.InviteID = reader.GetInt64(2); if (!reader.IsDBNull(3)) activitiesInvite.InviteaTime = reader.GetDateTime(3); if (!reader.IsDBNull(4)) activitiesInvite.ActiveitesID = reader.GetInt32(4); activitiesInvite.MarkOld(); activitiesInvitelist.Add(activitiesInvite); } reader.Close(); } return activitiesInvitelist; }
public IList<Core.Business.AccountGroup> GetAccountGroupByAccountIdOrGroupId(long accountId, int groupId) { IList<Core.Business.AccountGroup> accountGroupList = new List<Core.Business.AccountGroup>(); SqlServerUtility sql = new SqlServerUtility(SqlConnection); sql.AddParameter("@AccountId", SqlDbType.BigInt, accountId); sql.AddParameter("@GroupId", SqlDbType.Int, groupId); SqlDataReader reader = sql.ExecuteSPReader("USP_AccountGroup_Select_By_AccountId_And_GroupId"); if (reader != null) { while (reader.Read()) { Core.Business.AccountGroup accountGroup = new AccountGroup(); if (!reader.IsDBNull(0)) accountGroup.Id = reader.GetInt64(0); if (!reader.IsDBNull(1)) accountGroup.AccountId = reader.GetInt64(1); if (!reader.IsDBNull(2)) accountGroup.GroupId = reader.GetInt32(2); if (!reader.IsDBNull(3)) accountGroup.DateCreated = reader.GetDateTime(3); if (!reader.IsDBNull(4)) accountGroup.Role = reader.GetInt32(4); if (!reader.IsDBNull(5)) accountGroup.LastVisitDate = reader.GetDateTime(5); if (!reader.IsDBNull(6)) accountGroup.Name = reader.GetString(6); accountGroup.MarkOld(); accountGroupList.Add(accountGroup); } reader.Close(); } return accountGroupList; }
public Account FindByName(string loginName, string password) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@LoginName", SqlDbType.NVarChar, loginName); sql.AddParameter("@Password", SqlDbType.NVarChar, password); SqlDataReader reader = sql.ExecuteSqlReader(SqlFindBy); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.Account account = new Core.Business.Account(); if (!reader.IsDBNull(0)) account.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) account.Status = reader.GetInt32(1); if (!reader.IsDBNull(2)) account.Birthday = reader.GetDateTime(2); if (!reader.IsDBNull(3)) account.Gender = reader.GetDecimal(3); if (!reader.IsDBNull(4)) account.Name = reader.GetString(4); if (!reader.IsDBNull(5)) account.Telephone = reader.GetString(5); if (!reader.IsDBNull(6)) account.Address = reader.GetString(6); if (!reader.IsDBNull(7)) account.LoginName = reader.GetString(7); if (!reader.IsDBNull(8)) account.Password = reader.GetString(8); if (!reader.IsDBNull(9)) account.AvatarPath = reader.GetString(9); reader.Close(); return account; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }
public Core.Business.RoomInfo GetByBuildAndNo(string BuildCode, string RoomNo) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@BuildingCode", SqlDbType.NVarChar, BuildCode); sql.AddParameter("@RoomNum", SqlDbType.NVarChar, RoomNo); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetByBuildAndNo); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.RoomInfo roomInfo = new Core.Business.RoomInfo(); if (!reader.IsDBNull(0)) roomInfo.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) roomInfo.RoomCode = reader.GetString(1); if (!reader.IsDBNull(2)) roomInfo.BuildingCode = reader.GetString(2); if (!reader.IsDBNull(3)) roomInfo.RoomNum = reader.GetString(3); if (!reader.IsDBNull(4)) roomInfo.TotalNum = reader.GetInt32(4); //if (!reader.IsDBNull(5)) roomInfo.ExistNum = reader.GetInt32(5); //if (!reader.IsDBNull(6)) roomInfo.AvailNum = reader.GetInt32(6); if (!reader.IsDBNull(7)) roomInfo.RoomState = reader.GetString(7); reader.Close(); roomInfo.MarkOld(); return roomInfo; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }
public void Insert(Core.Business.CommissionedCompletionRecord commissionedCompletionRecord) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@ApplicationID", SqlDbType.UniqueIdentifier, commissionedCompletionRecord.ApplicationID); sql.AddParameter("@FillPerson", SqlDbType.UniqueIdentifier, commissionedCompletionRecord.FillPerson); sql.AddParameter("@AchieveTime", SqlDbType.DateTime, commissionedCompletionRecord.AchieveTime); sql.AddParameter("@SamplesNub", SqlDbType.Float, commissionedCompletionRecord.SamplesNub); sql.AddParameter("@MachineTime", SqlDbType.Float, commissionedCompletionRecord.MachineTime); sql.AddParameter("@Charges", SqlDbType.NVarChar, commissionedCompletionRecord.Charges); sql.AddParameter("@FeesReceivable", SqlDbType.NVarChar, commissionedCompletionRecord.FeesReceivable); sql.AddParameter("@ActualCharges", SqlDbType.NVarChar, commissionedCompletionRecord.ActualCharges); sql.AddParameter("@Units", SqlDbType.UniqueIdentifier, commissionedCompletionRecord.Units); sql.AddParameter("@FillTime", SqlDbType.DateTime, commissionedCompletionRecord.FillTime); sql.AddOutputParameter("@Id", SqlDbType.UniqueIdentifier); SqlDataReader reader = sql.ExecuteSPReader("usp_InsertCommissionedCompletionRecord"); if (reader != null && !reader.IsClosed && reader.Read()) { if (!reader.IsDBNull(0)) commissionedCompletionRecord.Id = reader.GetGuid(0); reader.Close(); } else { if (reader != null && !reader.IsClosed) reader.Close(); } }
public IList<CY.UME.Core.Business.WishingExtend> GetWishesByActivityIdAndAccountId(long? accountId, string activityId, int count) { IList<Core.Business.WishingExtend> wishingExtendlist = new List<Core.Business.WishingExtend>(); SqlServerUtility sql = new SqlServerUtility(SqlConnection); if (accountId == null) { accountId = 0; } //sql.AddParameter("@AccountId", SqlDbType.BigInt, accountId); sql.AddParameter("@ActivityId", SqlDbType.NVarChar, activityId); sql.AddParameter("@Count", SqlDbType.Int, count); SqlDataReader reader = sql.ExecuteSPReader("USP_WishingExtend_Select_By_ActivityId_And_AccountId"); if (reader != null) { while (reader.Read()) { Core.Business.WishingExtend wishingExtend = new Core.Business.WishingExtend(); long id = 0; if (!reader.IsDBNull(0)) id = reader.GetInt64(0); wishingExtend = CY.UME.Core.Business.WishingExtend.Load(id); wishingExtend.MarkOld(); wishingExtendlist.Add(wishingExtend); } reader.Close(); } return wishingExtendlist; }
public int GetTopicesNumByInstanceAndType(string strType, string strInstanceId,int level) { int count = 0; SqlServerUtility sql = new SqlServerUtility(connectionString); sql.AddParameter("@Type", SqlDbType.NVarChar, strType); sql.AddParameter("@InstanceId", SqlDbType.NVarChar, strInstanceId); if (level != -1) { sql.AddParameter("@Level", SqlDbType.NVarChar, level); } SqlDataReader reader = sql.ExecuteSPReader("USP_TopicExtend_GetTopicCount_By_InstanceId_And_Type"); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.TopicExtend topicExtend = new Core.Business.TopicExtend(); if (!reader.IsDBNull(0)) count = reader.GetInt32(0); reader.Close(); return count; } else { if (reader != null && !reader.IsClosed) reader.Close(); return 0; } }
public IList<Core.Business.ConductInfo> GetAvgScore(string year,int term,string grade) { IList<Core.Business.ConductInfo> conductInfolist = new List<Core.Business.ConductInfo>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@Year", SqlDbType.NVarChar, year); sql.AddParameter("@Term", SqlDbType.Int, term); sql.AddParameter("@Grade", SqlDbType.NVarChar, grade); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAvgScore); if (reader != null) { while (reader.Read()) { Core.Business.ConductInfo conductInfo = new Core.Business.ConductInfo(); if (!reader.IsDBNull(0)) conductInfo.AvgScore = reader.GetDecimal(0); if (!reader.IsDBNull(1)) conductInfo.StdCode = reader.GetString(1); if (!reader.IsDBNull(2)) conductInfo.YearNum = reader.GetString(2); if (!reader.IsDBNull(3)) conductInfo.Grade = reader.GetString(3); if (!reader.IsDBNull(4)) conductInfo.Term = reader.GetInt32(4); conductInfo.MarkOld(); conductInfolist.Add(conductInfo); } reader.Close(); } else { return null; } return conductInfolist; }
public IList<CY.CSTS.Core.Business.MachineGroupMember> GetMachineGroupMemberDynamic(string whereCondition, string orderByExpression) { if (string.IsNullOrEmpty(whereCondition)) { return this.GetAllMachineGroupMember(); } IList<Core.Business.MachineGroupMember> machineGroupMemberlist = new List<Core.Business.MachineGroupMember>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, whereCondition); sql.AddParameter("@OrderByExpression", SqlDbType.NVarChar, orderByExpression); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectMachineGroupMembersDynamic"); if (reader != null) { while (reader.Read()) { Core.Business.MachineGroupMember machineGroupMember = new Core.Business.MachineGroupMember(); if (!reader.IsDBNull(0)) machineGroupMember.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) machineGroupMember.MachineGroupID = reader.GetGuid(1); if (!reader.IsDBNull(2)) machineGroupMember.InstruID = reader.GetGuid(2); if (!reader.IsDBNull(3)) machineGroupMember.UserID = reader.GetGuid(3); machineGroupMember.MarkOld(); machineGroupMemberlist.Add(machineGroupMember); } reader.Close(); } return machineGroupMemberlist; }
public void Add(CY.HotelBooking.Core.Business.Web_Module m) { SqlServerUtility sqlhelper = new SqlServerUtility(); sqlhelper.AddParameter("@Module_Code", SqlDbType.VarChar, m.Module_Code, 10); sqlhelper.AddParameter("@Module_Name", SqlDbType.VarChar, m.Module_Name, 20); sqlhelper.AddParameter("@Module_IsParent", SqlDbType.VarChar, m.Module_IsParent); SqlDataReader reader = sqlhelper.ExecuteSqlReader(strSQLInsert); if (reader != null && !reader.IsClosed && reader.Read()) { if (!reader.IsDBNull(0)) { int id; if (int.TryParse(reader.GetValue(0).ToString(), out id)) { m.Id = id; } } reader.Close(); } else { if (reader != null && !reader.IsClosed) reader.Close(); } }
public int GetAccountOperationByTypeAndDayCount(String AccountName, String Email, int Day, String Type, String Sort) { SqlServerUtility sql = new SqlServerUtility(connectionString); if (AccountName.Length >= 1) sql.AddParameter("@AccountName", SqlDbType.NVarChar, AccountName); if (Email.Length >= 1) sql.AddParameter("@Email", SqlDbType.NVarChar, Email); sql.AddParameter("@Day", SqlDbType.Int, Day); sql.AddParameter("@Type", SqlDbType.NVarChar, Type); sql.AddParameter("@Sort", SqlDbType.NVarChar, Sort); SqlDataReader reader = sql.ExecuteSPReader("USP_AccountOperation_Select_By_Type_And_Day_Count"); if (reader != null) { int count = 0; while (reader.Read()) { if (!reader.IsDBNull(0)) count++; } reader.Close(); return count; } else { if (reader != null && !reader.IsClosed) reader.Close(); return 0; } }
public IList<Core.Business.Vote> GetVotesByUserRole(int departmentId,int userRoleId) { IList<Core.Business.VoteRole> voteRolelist = new List<Core.Business.VoteRole>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@DepartmentID", SqlDbType.Int, departmentId); sql.AddParameter("@RoleID", SqlDbType.Int, userRoleId); SqlDataReader reader = sql.ExecuteSqlReader(SqlGetVotesByUserRole); if (reader != null) { while (reader.Read()) { Core.Business.VoteRole voteRole = new Core.Business.VoteRole(); if (!reader.IsDBNull(0)) voteRole.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) voteRole.DepartmentID = reader.GetInt32(1); if (!reader.IsDBNull(2)) voteRole.VoteID = reader.GetInt32(2); if (!reader.IsDBNull(3)) voteRole.RoleID = reader.GetInt32(3); voteRole.MarkOld(); voteRolelist.Add(voteRole); } reader.Close(); } IList<Core.Business.Vote> voteList = new List<Core.Business.Vote>(); for (int i = 0; i < voteRolelist.Count; i++) { Core.Business.Vote vote = Core.Business.Vote.Load(voteRolelist[i].VoteID); voteList.Add(vote); } return voteList; }
public PicNode FindByPath(string path) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@Path", SqlDbType.NVarChar, path); sql.AddParameter("@Status", SqlDbType.Int, 0); SqlDataReader reader = sql.ExecuteSqlReader(SqlFindByPath); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.PicNode picNode = new Core.Business.PicNode(); if (!reader.IsDBNull(0)) picNode.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) picNode.Status = reader.GetInt32(1); if (!reader.IsDBNull(2)) picNode.IsFile = reader.GetBoolean(2); if (!reader.IsDBNull(3)) picNode.Root = reader.GetString(3); if (!reader.IsDBNull(4)) picNode.Path = reader.GetString(4); if (!reader.IsDBNull(5)) picNode.Name = reader.GetString(5); reader.Close(); return picNode; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }
public IList<PV> GetPVDynamic(string whereCondition, string orderByExpression) { if (string.IsNullOrEmpty(whereCondition)) { return this.GetAllPV(); } IList<Core.Business.PV> pVlist = new List<Core.Business.PV>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, whereCondition); sql.AddParameter("@OrderByExpression", SqlDbType.NVarChar, orderByExpression); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectPVsDynamic"); if (reader != null) { while (reader.Read()) { Core.Business.PV pV = new Core.Business.PV(); if (!reader.IsDBNull(0)) pV.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) pV.IP = reader.GetString(1); if (!reader.IsDBNull(2)) pV.VisitDate = reader.GetDateTime(2); pV.MarkOld(); pVlist.Add(pV); } reader.Close(); } return pVlist; }
public IList<Core.Business.ExhibitionManufacturer> GetExhibitionManufacturerByPage(string sqlwhere, int pagenumber, int pagesize) { IList<Core.Business.ExhibitionManufacturer> exhibitionManufacturerlist = new List<Core.Business.ExhibitionManufacturer>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@Tables", SqlDbType.VarChar, "ExhibitionManufacturer"); sql.AddParameter("@PK", SqlDbType.VarChar, "Id"); sql.AddParameter("@PageNumber", SqlDbType.Int, pagenumber); sql.AddParameter("@PageSize", SqlDbType.Int, pagesize); //sql.AddParameter("@LawSortID", SqlDbType.UniqueIdentifier, sortId); sql.AddParameter("@Filter", SqlDbType.VarChar, sqlwhere); SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount"); if (reader != null) { while (reader.Read()) { Core.Business.ExhibitionManufacturer exhibitionManufacturer = new Core.Business.ExhibitionManufacturer(); if (!reader.IsDBNull(0)) exhibitionManufacturer.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) exhibitionManufacturer.ManufacturerID = reader.GetGuid(1); if (!reader.IsDBNull(2)) exhibitionManufacturer.InstrumentDate = reader.GetDateTime(2); if (!reader.IsDBNull(3)) exhibitionManufacturer.SequenceNumber = reader.GetInt32(3); if (!reader.IsDBNull(4)) exhibitionManufacturer.IsShowinHomePage = reader.GetInt32(4); exhibitionManufacturer.MarkOld(); exhibitionManufacturerlist.Add(exhibitionManufacturer); } reader.Close(); } return exhibitionManufacturerlist; }
public IList<CY.UME.Core.Business.PictureExtend> GetActivityPicture(long accountId, string activityId,string activityPicId) { IList<Core.Business.PictureExtend> pictureExtendlist = new List<Core.Business.PictureExtend>(); SqlServerUtility sql = new SqlServerUtility(connectionString); sql.AddParameter("@AccountId", SqlDbType.BigInt, accountId); sql.AddParameter("@ActivityId", SqlDbType.NVarChar, activityId); sql.AddParameter("@ActivityPicId", SqlDbType.NVarChar, activityPicId); SqlDataReader reader = sql.ExecuteSPReader("USP_PictureExtend_Select_By_AccountId_And_ActivityId_And_ActivityPicId"); if (reader != null) { while (reader.Read()) { Core.Business.PictureExtend pictureExtend = new Core.Business.PictureExtend(); long Id = 0; if (!reader.IsDBNull(0)) Id = reader.GetInt64(0); pictureExtend = CY.UME.Core.Business.PictureExtend.Load(Id); pictureExtend.MarkOld(); pictureExtendlist.Add(pictureExtend); } reader.Close(); } return pictureExtendlist; }
//��ȡ������Ϣ��¼������ public int GetFeedBacksCount(int KindId, string BeginTime, string EndTime) { SqlServerUtility sql = new SqlServerUtility(SqlConnectionString); sql.AddParameter("@KindId", SqlDbType.Int, KindId); if (BeginTime.Length >= 1) sql.AddParameter("@BeginTime", SqlDbType.NVarChar, BeginTime); if (EndTime.Length >= 1) sql.AddParameter("@EndTime", SqlDbType.NVarChar, EndTime); SqlDataReader reader = sql.ExecuteSPReader("USP_FeedBack_Count"); if (reader != null && !reader.IsClosed && reader.Read()) { int count = 0; if (!reader.IsDBNull(0)) count = reader.GetInt32(0); reader.Close(); return count; } else { if (reader != null && !reader.IsClosed) reader.Close(); return 0; } }