protected void Initial(ref CY.GFive.Core.Business.NewsContent HotestNews, ref List<CY.GFive.Core.Business.NewsContent> LastestNews) { try { /// 新闻 CY.GFive.Core.Business.NewsModule module = CY.GFive.Core.Business.NewsModule.GetAllNewsModule().Where(item => item.Name.Contains("新闻") && !item.WBS.Contains(".")).FirstOrDefault(); if (module != null) { LastestNews = CY.GFive.Core.Business.NewsContent.Search(new CY.GFive.Core.Business.NewsSearchJson { Module = (Guid?)module.Id }, new CY.GFive.Core.Business.PagingInfo()).Reverse().Take(11).ToList(); HotestNews = CY.GFive.Core.Business.NewsContent.GetEnrollSingleTon(module); Guid id = Guid.Empty; if (HotestNews != null) { id = HotestNews.Id; } if (LastestNews != null && HotestNews != null && LastestNews.Find(item => item.Id == id) != null) { LastestNews.RemoveAt(LastestNews.FindIndex(item => item.Id == id)); } } } catch (Exception ex) { throw ex; } }
public string checkFiscalYear(string month, string year) { string FY = ""; try { int MM, CY, AY; MM = Int32.Parse(month); CY = Int32.Parse(year); if (MM < 4) { AY = CY - 1; FY = AY.ToString() + "/" + CY.ToString().Substring(2, 2); } else if (MM >= 4) { AY = CY + 1; FY = CY.ToString() + "/" + AY.ToString().Substring(2, 2); } else { } } catch { } return(FY); }
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 IList<Core.Business.Grade> GetAllGrade(CY.UME.Core.PagingInfo pagingInfo) { IList<Core.Business.Grade> gradelist = new List<Core.Business.Grade>(); SqlServerUtility sql = new SqlServerUtility(SqlConnectionString); sql.AddParameter("@PageNumber", SqlDbType.Int, pagingInfo.CurrentPage); sql.AddParameter("@PageSize", SqlDbType.Int, pagingInfo.PageSize); sql.AddParameter("@Tables", SqlDbType.NVarChar, "Grade"); sql.AddParameter("@PK", SqlDbType.NVarChar, "Id"); sql.AddParameter("@Sort", SqlDbType.NVarChar, "Id DESC"); sql.AddParameter("@Fields", SqlDbType.NVarChar, "[Id], [Year]"); //sql.AddParameter("@Filter", SqlDbType.NVarChar, ""); SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount"); if (reader != null) { while (reader.Read()) { Core.Business.Grade grade = new Core.Business.Grade(); if (!reader.IsDBNull(0)) grade.Id = reader.GetInt32(0); if (!reader.IsDBNull(1)) grade.Year = reader.GetInt32(1); grade.MarkOld(); gradelist.Add(grade); } reader.Close(); } return gradelist; }
/// <summary> /// 构建 Unit /// </summary> protected string ConstructorUnit(CY.CSTS.Core.Business.UnitSearchJson json, CY.CSTS.Core.Business.PagingInfo pageinfo) { StringBuilder sbResult = new StringBuilder(); try { if (json == null || pageinfo == null) { throw new Exception("error"); } sbResult.Append("["); IEnumerable<CY.CSTS.Core.Business.UnitInfo> units = CY.CSTS.Core.Business.UnitInfo.SelectUnitinfoBySearchConditionPageInfo(json, pageinfo); if (units != null) { foreach (CY.CSTS.Core.Business.UnitInfo unit in units) { sbResult.Append("{"); sbResult.Append(string.Format("id:'{0}'", CY.Utility.Common.StringUtility.HTMLEncode(unit.Id.ToString()))); sbResult.Append(string.Format(",name:'{0}'", CY.Utility.Common.StringUtility.HTMLEncode(unit.UnitName))); sbResult.Append("},"); } if (units.Count() > 0) { sbResult.Remove(sbResult.Length - 1, 1); } } sbResult.Append("]"); } catch (Exception ex) { throw ex; } return sbResult.ToString(); }
public List<CY.UME.Core.Business.Notice> GetAllNotice(CY.UME.Core.Business.Account account) { List<Core.Business.Notice> noticelist = new List<Core.Business.Notice>(); SqlServerUtility sql = new SqlServerUtility(connectionString); sql.AddParameter("@AccountId", SqlDbType.BigInt, account.Id); SqlDataReader reader = sql.ExecuteSPReader("USP_Notice_SelectAll_By_AccountId"); if (reader != null) { while (reader.Read()) { Core.Business.Notice notice = new Core.Business.Notice(); if (!reader.IsDBNull(0)) notice.Id = reader.GetInt64(0); if (!reader.IsDBNull(1)) notice.Content = reader.GetString(1); if (!reader.IsDBNull(2)) notice.AccountId = reader.GetInt64(2); if (!reader.IsDBNull(3)) notice.AuthorId = reader.GetInt64(3); if (!reader.IsDBNull(4)) notice.DateCreated = reader.GetDateTime(4); if (!reader.IsDBNull(5)) notice.IsReaded = reader.GetBoolean(5); if (!reader.IsDBNull(6)) notice.Type = reader.GetString(6); if (!reader.IsDBNull(7)) notice.InstanceId = reader.GetString(7); notice.MarkOld(); noticelist.Add(notice); } reader.Close(); } return noticelist; }
/// <summary> /// ��ø��û������ĺ������� /// </summary> /// <param name="account"></param> /// <returns></returns> public IList<CY.UME.Core.Business.Friendship> GetAccountRequestList(CY.UME.Core.Business.Account account) { string sqlstr = "AccountId=" + account.Id; IList<Core.Business.Friendship> friendshiplist = new List<Core.Business.Friendship>(); SqlServerUtility sql = new SqlServerUtility(connectionString); string sqlwhere = "SELECT * FROM [dbo].[Friendship] where "; sqlwhere += sqlstr + " ORDER BY [Id] desc"; SqlDataReader reader = sql.ExecuteSqlReader(sqlwhere); if (reader != null) { while (reader.Read()) { Core.Business.Friendship friendship = new Core.Business.Friendship(); if (!reader.IsDBNull(0)) friendship.Id = reader.GetInt64(0); if (!reader.IsDBNull(1)) friendship.AccountId = reader.GetInt64(1); if (!reader.IsDBNull(2)) friendship.FriendId = reader.GetInt64(2); if (!reader.IsDBNull(3)) friendship.GroupId = reader.GetInt64(3); if (!reader.IsDBNull(4)) friendship.IsChecked = reader.GetBoolean(4); if (!reader.IsDBNull(5)) friendship.Remark = reader.GetString(5); if (!reader.IsDBNull(6)) friendship.CommunicateNum = reader.GetInt32(6); if (!reader.IsDBNull(7)) friendship.DateCreated = reader.GetDateTime(7); friendship.MarkOld(); friendshiplist.Add(friendship); } reader.Close(); } return friendshiplist; }
/// <summary> /// /// </summary> /// <param name="json"></param> /// <param name="centers"></param> /// <param name="assists"></param> protected void Initial(out CY.CSTS.Core.Business.InstrumentStatisticalJson json, out IEnumerable<CY.CSTS.Core.Business.UnitInfo> centers, out IEnumerable<CY.CSTS.Core.Business.UnitInfo> assists) { try { centers = CY.CSTS.Core.Business.UnitInfo.SelectUnitInfosByUnitFlag(CY.Utility.Common.CodeInterface.UnitFlag.SubCenter); if (centers != null) { centers = centers.Where(item => item.AuditingState == CY.Utility.Common.CodeInterface.UnitState.Audited); } assists = CY.CSTS.Core.Business.UnitInfo.SelectUnitInfosByUnitFlag(CY.Utility.Common.CodeInterface.UnitFlag.AssistUnit); if (assists != null) { assists = assists.Where(item => item.AuditingState == CY.Utility.Common.CodeInterface.UnitState.Audited); } json = new CY.CSTS.Core.Business.InstrumentStatisticalJson(); } catch (Exception ex) { throw ex; } }
private bool TryGetAccount(long accountId, out CY.UME.Core.Business.Account account) { account = null; if (accountId < 1) { return false; } try { account = CY.UME.Core.Business.Account.Load(accountId); if (account != null) { return true; } else { return false; } } catch { return false; } }
protected void BindData(CY.UME.Core.Business.Group group) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 20; if (group != null) { topicList = CY.UME.Core.Business.Topic.GetGroupTopicesByDateCreated(group.Id.ToString(), pageInfo); } int count = group.GetGroupTopicesNum(); DDLGroup.SelectedValue = group.Id.ToString(); authorname.Value = ""; minviewnum.Value = ""; maxviewnum.Value = ""; minreplynum.Value = ""; maxreplynum.Value = ""; title.Value = ""; isRecommend.SelectedIndex = 0; tm_HiddenPageSize.Value = "20"; tm_HiddenRecordCount.Value = count.ToString(); tm_HiddenSiteUrl.Value = SiteUrl; }
protected void BindData(CY.UME.Core.Business.Activities active) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 15; CY.UME.Core.Business.Album album = new CY.UME.Core.Business.Album(); if (active != null) { album = active.GetActiveAlbum(); picList = album.GetPictures(pageInfo); } int count = album.GetPictureCount(); minPubDate.Value = ""; maxPubDate.Value = ""; picname.Value = ""; authorName.Value = ""; gpm_HiddenPageSize.Value = "15"; gpm_HiddenRecordCount.Value = count.ToString(); gpm_HiddenSiteUrl.Value = SiteUrl; }
protected void BindData(CY.UME.Core.Business.Activities active) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 20; if (active != null) { topicList = CY.UME.Core.Business.Topic.GetActiveTopicesByDateCreated(active.Id.ToString(), pageInfo); } int count = active.GetActiveTopicesNum(); authorname.Value = ""; minviewnum.Value = ""; maxviewnum.Value = ""; minreplynum.Value = ""; maxreplynum.Value = ""; title.Value = ""; tm_HiddenPageSize.Value = "20"; tm_HiddenRecordCount.Value = count.ToString(); tm_HiddenSiteUrl.Value = SiteUrl; }
public void Insert(CY.HotelBooking.Core.Business.Settings setting) { SqlServerUtility db = new SqlServerUtility(); db.AddParameter("@HotelName", SqlDbType.NVarChar, setting.HotelName); db.AddParameter("@Copyright", SqlDbType.NVarChar, setting.Copyright); db.AddParameter("@Author", SqlDbType.NVarChar, setting.SysAuthor); db.AddParameter("@ReadInfo",SqlDbType.Text,setting.ReadInfo); db.AddParameter("@Contact", SqlDbType.Text, setting.Contact); db.AddParameter("@Address", SqlDbType.Text, setting.Address); db.AddParameter("@EmailBody", SqlDbType.Text, setting.EmailBody); SqlDataReader reader = db.ExecuteSqlReader(SqlInsertSetting); if (reader != null && !reader.IsClosed && reader.Read()) { if (!reader.IsDBNull(0)) { int id; if (int.TryParse(reader.GetValue(0).ToString(), out id)) { setting.Id = id; } } reader.Close(); } else { if (reader != null && !reader.IsClosed) reader.Close(); } }
public void AddMessage(String Content, CY.UME.Core.Business.AsynResult asynResult, String accountId) { //当传入的内容为"-1"时,表示为建立连接请求,即为了维持一个从客户端到服务器的链接而建立的链接(那个等待的链接) //此时该链接保存到Ilist<AsynResult> Clients中,等待再有消息发送过来时,该Clients会被遍历,并且会在该消息输出后结束该链接 if (Content == "-1") { Clients.Add(asynResult); } else { //将当前请求的内容输出到客户端 asynResult.Content = Content; asynResult.AccountId = accountId; asynResult.Send(null); //遍历说有已缓存的Clients,并将当前内容输出到客户端 foreach (AsynResult result in Clients) { result.Content = Content; result.AccountId = accountId; result.Send(null); } //清空Ilist<AsynResult> Clients Clients.Clear(); } }
private string BuildSubTreeClass(CY.GFive.Core.Business.Grade grade, CY.GFive.Core.Business.Profess profess) { StringBuilder subTreeClass = new StringBuilder(); try { if (grade != null && profess != null) { List<CY.GFive.Core.Business.ClassInfo> listClass = ClassInfo.GetByprofesscodegradecode(profess.ProCode, grade.GradeCode) as List<CY.GFive.Core.Business.ClassInfo>; if (listClass != null) { if (listClass.Count == 0) { subTreeClass.Append("<ul id='tree-sub-noClassItem'><li class='close' id='tree-sub-noclass'><div class='tree-node'><span>此年级无班级信息</span></div></li></ul>"); } else { for (int k = 0; k < listClass.Count; k++) { subTreeClass.Append( string.Format("<ul id='tree-sub-uiClass-{0}'><li class='close' id='tree-sub-class-{0}' classCode='{0}'><div class='tree-node'><span>{1}</span></div></li></ul>", listClass[k].ClassCode, listClass[k].ClassName)); } } } } } catch (Exception ex) { throw ex; } finally { } return subTreeClass.ToString(); }
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 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(); } }
private string BuildMenu(CY.CSTS.Core.Business.Control.sfMenu menu) { System.Text.StringBuilder sbResult = new StringBuilder(); try { if (menu != null) { sbResult.Append(string.Format("<ul id='{0}' >", menu.Name)); if (menu.SubMenu != null && menu.SubMenu.Count() > 0) { foreach (sfMenu m in menu.SubMenu) { sbResult.Append(string.Format("<li><a href='{0}'>{1}</a>", m.Url, m.Name)); if (m.SubMenu != null && m.SubMenu.Count() > 0) { sbResult.Append(BuildMenu(m)); } sbResult.Append("</li>"); } } sbResult.Append("</ul>"); } } catch (Exception ex) { throw ex; } return sbResult.ToString(); }
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; }
protected void BindData(CY.UME.Core.Business.Group group) { CY.UME.Core.PagingInfo pageInfo = new CY.UME.Core.PagingInfo(); pageInfo.CurrentPage = 1; pageInfo.PageSize = 15; CY.UME.Core.Business.Album album =new CY.UME.Core.Business.Album(); if (group != null) { album = group.GetGroupAlbum(); picList = album.GetPictures(pageInfo); } int count = album.GetPictureCount(); DDLGroup.SelectedValue = group.Id.ToString(); minPubDate.Value = ""; maxPubDate.Value = ""; picname.Value = ""; authorName.Value = ""; gpm_HiddenPageSize.Value = "15"; gpm_HiddenRecordCount.Value = count.ToString(); gpm_HiddenSiteUrl.Value = SiteUrl; }
public Form2(int a, int b) { f = a; q = b; string s = "Введите данные фигуры номер 1"; InitializeComponent(); outInfo.Text = s; if (a == 1) { textBox4.Dispose(); DX.Dispose(); DY.Dispose(); } else if (a == 2) { textBox2.Dispose(); BX.Dispose(); BY.Dispose(); textBox4.Dispose(); DX.Dispose(); DY.Dispose(); textBox1.Text = "цент"; textBox3.Text = "R"; CY.Dispose(); } }
public void Delete(CY.CSTS.Core.Business.VoteAnswer voteAnswer) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@Key", SqlDbType.Int, voteAnswer.Id); sql.ExecuteSql(SqlDeleteVoteAnswer); }
public IList<CY.UME.Core.Business.BlogType> GetBlogTypesByAccountId(CY.UME.Core.Business.Account account) { IList<Core.Business.BlogType> blogTypelist = new List<Core.Business.BlogType>(); if (account == null) { return blogTypelist; } SqlServerUtility sql = new SqlServerUtility(SqlConnection); sql.AddParameter("@AccountId", SqlDbType.BigInt, account.Id); SqlDataReader reader = sql.ExecuteSPReader("USP_BlogType_Select_By_AccountId"); if (reader != null) { while (reader.Read()) { Core.Business.BlogType blogType = new Core.Business.BlogType(); if (!reader.IsDBNull(0)) blogType.Id = reader.GetInt64(0); if (!reader.IsDBNull(1)) blogType.DateCreated = reader.GetDateTime(1); if (!reader.IsDBNull(2)) blogType.AccountId = reader.GetInt64(2); if (!reader.IsDBNull(3)) blogType.Name = reader.GetString(3); blogType.MarkOld(); blogTypelist.Add(blogType); } reader.Close(); } return blogTypelist; }
//[ydh]=@ydh and [dhlb]=@dhlb and [num]=@num" public void Delete(CY.HotelBooking.Core.Business.XX_KFFJYDB KFFJYDB) { SqlServerUtility db = new SqlServerUtility(); db.AddParameter("@ydh", SqlDbType.Decimal, KFFJYDB.Id.OrderCode); db.AddParameter("@dhlb", SqlDbType.Char, KFFJYDB.Id.dhlb); db.AddParameter("@num", SqlDbType.SmallInt, KFFJYDB.Id.Num); db.ExecuteSql(SQLDeleteByKey); }
private void BindTeam(CY.GFive.Core.Business.AcademicYear ay) { List<Semester> list = CY.GFive.Core.Business.Semester.Fill(ay) as List<Semester>; ddlTeam.DataSource = list; ddlTeam.DataTextField = "Name"; ddlTeam.DataValueField = "Id"; ddlTeam.DataBind(); }
public void DeleteRelativeGroups(CY.UME.Core.Business.Group group, CY.UME.Core.Business.Group relativeGroup) { SqlServerUtility sql = new SqlServerUtility(SqlConnection); sql.AddParameter("@GroupId", SqlDbType.Int, group.Id); sql.AddParameter("@RelativeGroupId", SqlDbType.Int, relativeGroup.Id); sql.ExecuteSP("USP_RelativeGroup_Delete_By_GroupId_And_RelativeGroupId"); }
public void Delete(CY.HotelBooking.Core.Business.User user) { SqlServerUtility db = new SqlServerUtility(); db.AddParameter("@User_ID", SqlDbType.Int, user.Id); db.ExecuteSql(SqlDeleteUserById); }
public IList<CY.UME.Core.Business.Album> GetAlbumByPagesAndAccountId(CY.UME.Core.Business.Account account, PagingInfo pageInfo, int viewPermission) { IList<Core.Business.Album> albumlist = new List<Core.Business.Album>(); SqlServerUtility sql = new SqlServerUtility(connectionString); StringBuilder sbFilter = new StringBuilder(); sbFilter.Append(" [AccountId] = "); sbFilter.Append(account.Id); string permission = String.Empty; if (viewPermission == 0)//�Լ����� { ; } else if (viewPermission == 1)//���ѷ��� { permission = "(0,1,2)"; } else if (viewPermission == 2)//İ���˷��� { permission = "(0,2)"; } else { return albumlist; } if (permission.Length != 0) { sbFilter.Append(" And ViewPermission in " + permission); } sql.AddParameter("@Tables", SqlDbType.VarChar, "Album"); sql.AddParameter("@PK", SqlDbType.VarChar, "Id"); sql.AddParameter("@Filter", SqlDbType.VarChar, sbFilter.ToString()); sql.AddParameter("@Fields", SqlDbType.VarChar, "[Id],[AccountId],[ViewPermission],[DateCreated],[LastModifiedTime],[IsAvatar],[Name],[CoverPath],[ViewPassword]"); sql.AddParameter("@PageNumber", SqlDbType.Int, pageInfo.CurrentPage); sql.AddParameter("@PageSize", SqlDbType.Int, pageInfo.PageSize); sql.AddParameter("@sort", SqlDbType.NVarChar, "Id DESC"); SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount"); if (reader != null) { while (reader.Read()) { Core.Business.Album album = new Core.Business.Album(); long id = reader.GetInt64(0); album = Core.Business.Album.Load(id); album.MarkOld(); albumlist.Add(album); } reader.Close(); } return albumlist; }
public void Delete(CY.HotelBooking.Core.Business.RoomCate roomcate) { if (roomcate != null) { SqlServerUtility db = new SqlServerUtility(); db.AddParameter("@kfcode", SqlDbType.VarChar, roomcate.Id, 4); db.ExecuteSql(SQLDeleteRoomCate); } }
public IList<CY.UME.Core.Business.SpaceCommentExtend> GetSpaceCommentExtendByInstanceIdAndType(string type, string instanceId, CY.UME.Core.PagingInfo pageInfo) { List<SpaceCommentExtend> comments = new List<SpaceCommentExtend>(); StringBuilder sbFilter = new StringBuilder(); sbFilter.Append("1=1"); if (type.Length > 0) { sbFilter.Append(" And [Type] = '"); sbFilter.Append(type); sbFilter.Append("'"); } if (instanceId.Length > 0) { sbFilter.Append(" And [InstanceId] = '"); sbFilter.Append(instanceId); sbFilter.Append("'"); } int pageSize = int.MaxValue; int pageNumber = 1; if (pageInfo != null) { pageSize = pageInfo.PageSize; pageNumber = pageInfo.CurrentPage; } SqlServerUtility sql = new SqlServerUtility(connectionString); sql.AddParameter("@Tables", SqlDbType.VarChar, "SpaceCommentExtend"); sql.AddParameter("@PK", SqlDbType.VarChar, "Id"); sql.AddParameter("@Fields", SqlDbType.VarChar, "[Id]"); sql.AddParameter("@Filter", SqlDbType.VarChar, sbFilter.ToString()); sql.AddParameter("@PageNumber", SqlDbType.Int, pageNumber); sql.AddParameter("@PageSize", SqlDbType.Int, pageSize); sql.AddParameter("@Sort", SqlDbType.VarChar, "Id desc"); SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount"); if (reader != null) { while (reader.Read()) { Core.Business.SpaceCommentExtend spaceCommentExtend = new Core.Business.SpaceCommentExtend(); long id = reader.GetInt64(0); spaceCommentExtend = Core.Business.SpaceCommentExtend.Load(id); spaceCommentExtend.MarkOld(); comments.Add(spaceCommentExtend); } reader.Close(); } return comments; }
public void Delete(CY.HotelBooking.Core.Business.OrderDetail orderdetail) { if (orderdetail == null) throw new NullReferenceException("OrderDetail For Delete is null"); SqlServerUtility db = new SqlServerUtility(); db.AddParameter("@yddh", SqlDbType.Decimal, orderdetail.Id.OrderCode); db.AddParameter("@num", SqlDbType.SmallInt, (short)orderdetail.Id.Num); db.ExecuteSql(SQLDelete); }
public IList<CY.UME.Core.Business.RelativeGroup> GetRelativeGroups(int groupId, int relativeGroupId, bool isChecked, CY.UME.Core.PagingInfo pageInfo) { IList<Core.Business.RelativeGroup> relativeGrouplist = new List<Core.Business.RelativeGroup>(); SqlServerUtility sql = new SqlServerUtility(SqlConnection); #region 参数 string tables = "RelativeGroup"; string pK = "Id"; string sort = "DateCreated Desc"; int pageNum = pageInfo.CurrentPage; int pageSize = pageInfo.PageSize; string fields = "[Id], [GroupId],[RelativeGroupId],[DateCreated],[IsChecked],[Remark]"; string filter = "1=1 "; if (groupId != 0) { filter += " and GroupId=" + groupId; } if (relativeGroupId != 0) { filter += " and RelativeGroupId=" + relativeGroupId; } filter += " and IsChecked=" + (isChecked ? 1 : 0); string group = String.Empty; #endregion sql.AddParameter("@Tables", SqlDbType.VarChar, tables); sql.AddParameter("@PK", SqlDbType.VarChar, pK); sql.AddParameter("@Sort", SqlDbType.VarChar, sort); sql.AddParameter("@PageNumber", SqlDbType.Int, pageNum); sql.AddParameter("@PageSize", SqlDbType.Int, pageSize); sql.AddParameter("@Fields", SqlDbType.VarChar, fields); sql.AddParameter("@Filter", SqlDbType.VarChar, filter); sql.AddParameter("@Group", SqlDbType.VarChar, group); SqlDataReader reader = sql.ExecuteSPReader("Paging_RowCount"); if (reader != null) { while (reader.Read()) { Core.Business.RelativeGroup relativeGroup = new Core.Business.RelativeGroup(); if (!reader.IsDBNull(0)) relativeGroup.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) relativeGroup.GroupId = reader.GetInt32(1); if (!reader.IsDBNull(2)) relativeGroup.RelativeGroupId = reader.GetInt32(2); if (!reader.IsDBNull(3)) relativeGroup.DateCreated = reader.GetDateTime(3); if (!reader.IsDBNull(4)) relativeGroup.IsChecked = reader.GetBoolean(4); if (!reader.IsDBNull(5)) relativeGroup.Remark = reader.GetString(5); relativeGroup.MarkOld(); relativeGrouplist.Add(relativeGroup); } reader.Close(); } return relativeGrouplist; }
public string HisBalance(ParamBalance pb) { int zyh = pb.zyh; string hr = string.Empty; StringBuilder sb = null; int iHr = -1; HrPreClearing hrPreClearing = null; SqlConnection hisConn = new SqlConnection(GSettings.HisConnStr); SqlTransaction hisTrans = null; DCCbhisDataContext hisDb = new DCCbhisDataContext(hisConn); try { hisConn.Open(); var brInfo = (from _r in hisDb.RY where _r.ZYH == zyh && _r.ZT == 0 && _r.ZF == 0 && _r.RegID == null select _r).FirstOrDefault(); if (brInfo == null) { throw new Exception("未找到患者有效的在院信息或者该患者不是现金及农合患者!"); } #region 预处理 //记床位费; hisDb.ExecuteCommand("exec 住院收费_记单个病人床位费 {0}", zyh); //查询已记账未发药的单据 var noPutHjds = hisDb.ExecuteQuery <string>(@"select a.hjdh from jzd a join hjd b on a.hjdh=b.hjdh join bm c on a.kdks=c.bmdm join bm d on a.zxks=d.bmdm join zg e on a.czy=e.zgdm left join zg f on a.ys=f.zgdm where a.zyh={0} and a.hjdh is not null and b.fyrq is null and b.zf<>1", zyh).ToArray(); if (noPutHjds != null && noPutHjds.Length > 0) { throw new Exception(string.Format(@"划价单:{0} 已记账未发药!", string.Join(",", noPutHjds))); } //查询划价单已作废,记账单未作废的单据 var noDelInvoidJzds = hisDb.ExecuteQuery <string>(@"select jzdh from jzd where jzdh in (select jzdh from hjd where zf=1) and zyh={0} and zf=0", zyh).ToArray(); if (noDelInvoidJzds != null && noDelInvoidJzds.Length > 0) { throw new Exception(string.Format(@"划价单:{0} 已记账未发药!", string.Join(",", noDelInvoidJzds))); } var operatorTicketSerial = (from _t in hisDb.DQDJH where _t.CZY == GSettings.OperatorID && _t.DJLXDM == 4 select _t).FirstOrDefault(); if (operatorTicketSerial == null) { throw new Exception("当前操作员未分配单据号!"); } int curTickSerail = hisDb.ExecuteQuery <int>("SELECT SJH=ISNULL(MAX(CYFPH),1) FROM CYFP WHERE CYFPH>0 AND CZY={0}", GSettings.OperatorID).First(); if (curTickSerail == 1) { curTickSerail = operatorTicketSerial.KSDJH.Value; } else { curTickSerail += 1; } if (curTickSerail > operatorTicketSerial.JSDJH.Value) { throw new Exception("当前操作员出院发票已用完,请联系分配人员重新分配住院发票!"); } int cyxh = hisDb.ExecuteQuery <int>("select isnull(max(cyxh),0)+1 from cy").FirstOrDefault(); var sumFee = hisDb.ExecuteQuery <OutValue_sp_GetInHosSumFee_List>("exec sp_GetInHosSumFee_List {0}", zyh).FirstOrDefault(); var zjBqye = hisDb.ExecuteQuery <decimal>(@"select top 1 bqye from cyfp where zyh={0} and cyxh is null order by rq desc, ztjz_zzrq desc, cyfph desc", zyh).FirstOrDefault(); sumFee.yjk += zjBqye; DateTime serverTime = hisDb.ExecuteQuery <DateTime>("select getdate()").FirstOrDefault(); #endregion #region 预结算 //预结算一下,并判断两边的费用是否一致;如果不一致则抛出错误,让结算人员重新上传费用; var nhRegisterInfo = (from _r in hisDb.WyNhRegister where _r.Zyh == zyh && _r.IsFail == 0 select _r).FirstOrDefault(); if (nhRegisterInfo != null) { //先判断一下是否有有效的结算信息 var _validBalance = (from _b in nhRegisterInfo.WyNhBalance where _b.IsFail == 0 select _b).FirstOrDefault(); if (_validBalance != null) { throw new Exception("该农合患者已存在有效的结算信息,请检查!"); } //如果nhRegisterInfo不为Null,则是农合患者,先预结算一下; sb = new StringBuilder(500); iHr = NhLocalWrap.PreClearing(string.Format("{0}$${1}", nhRegisterInfo.OrganCode, nhRegisterInfo.AccountYear), nhRegisterInfo.CoopMedCode, nhRegisterInfo.AiIDNo, int.Parse(nhRegisterInfo.DiagNo), 0, hisDb.getTsByZyh(zyh, pb.outDate).Value, pb.outDate.ToString("yyyy-MM-dd HH:mm:ss"), serverTime.ToString("yyyy-MM-dd HH:mm:ss"), "1", sb); if (iHr < 0) { throw new Exception(string.Format(@"预结算错误:{0}", sb.ToString())); } hrPreClearing = sb.ToString(); if (hrPreClearing.TotalFee != sumFee.yszje) { throw new Exception("农合服务器金额和本地His金额不一致,请检查费用是否全部上传完毕!"); } } #endregion //开始事务处理 hisTrans = hisConn.BeginTransaction(); hisDb.Transaction = hisTrans; //①,insert to cy CY newCy = new CY(); newCy.CYXH = cyxh; newCy.ZYH = zyh; newCy.CYFPH = curTickSerail; newCy.ksdm = brInfo.KSDM.Value; newCy.CYRQ = pb.outDate; newCy.HJJE = sumFee.zje; newCy.HJJE_YS = sumFee.yszje; newCy.YJJE = sumFee.yjk; newCy.BJJE = sumFee.yszje - sumFee.yjk; newCy.QFJE = 0; newCy.QF = 0; newCy.BXJE = 0; newCy.QFLBMC = null; newCy.czy = GSettings.OperatorID; newCy.fkfs = "现金"; newCy.jsdw = ""; newCy.ZF = 0; newCy.jbsj = serverTime; hisDb.CY.InsertOnSubmit(newCy); hisDb.SubmitChanges(); //②,insert to cyfp hisDb.ExecuteCommand(@"INSERT INTO CYFP(CYFPH, CYXH, RQ, JSDW, HJJE, HJJE_YS, YJJE, BJJE, CZY, BXJE, ZYH, SQYE, ZF) SELECT CYFPH,CYXH, CYRQ,'', HJJE, HJJE_YS, YJJE, BJJE, CZY, BXJE, ZYH, {1}, 0 FROM CY WHERE CYXH = {0}", cyxh, zjBqye); //③,insert to cyfpmx var cyfpmxs = hisDb.ExecuteQuery <OutValue_sp_GetInHosSumFee>("exec sp_GetInHosSumFee @Zyh={0}, @LSH='%'", zyh); short _xh = 1; foreach (var cyfpmx in cyfpmxs) { hisDb.CYFPMX.InsertOnSubmit(new CYFPMX() { CYFPH = curTickSerail, XH = _xh++, YJKMDM = cyfpmx.yjkmdm, JE = cyfpmx.zje, YSJE = cyfpmx.ysje }); } //④更新相关表,Ry,zybr_child,bc,bcsyjl brInfo.ZT = 1; brInfo.JBSJ = serverTime; brInfo.CYRQ = pb.outDate; brInfo.CYBJJE = -1 * brInfo.YE; brInfo.YE = 0; hisDb.SubmitChanges(); hisDb.ExecuteCommand(@"update zybr_child set cyrq={0} where zyh={1}", pb.outDate, zyh); hisDb.ExecuteCommand(@"UPDATE BC SET ZYH=NULL,FCRQ=NULL, FYJSRQ=NULL WHERE ZYH={0}", zyh); hisDb.ExecuteCommand(@"UPDATE BCSYJL SET JSRQ=b.CYRQ, BS=2 FROM BCSYJL a JOIN RY b ON a.ZYH = b.ZYH WHERE b.ZYH={0} AND a.JSRQ IS NULL", zyh); //如果是农合患者,则进行农合结算; WyNhBalance nhBalance = null; if (nhRegisterInfo != null) { nhBalance = new WyNhBalance(); nhBalance.BalanceID = Guid.NewGuid(); nhBalance.NhRegID = nhRegisterInfo.NhRegID; nhBalance.IsFail = 0; nhBalance.DayCount = hisDb.getTsByZyh(zyh, pb.outDate).Value; nhBalance.OutDate = pb.outDate; nhBalance.JsDate = serverTime; nhBalance.Zyh = zyh; nhBalance.Cyfph = curTickSerail; hisDb.WyNhBalance.InsertOnSubmit(nhBalance); hisDb.SubmitChanges(); sb = new StringBuilder(500); iHr = NhLocalWrap.PreClearing(string.Format("{0}$${1}", nhRegisterInfo.OrganCode, nhRegisterInfo.AccountYear), nhRegisterInfo.CoopMedCode, nhRegisterInfo.AiIDNo, int.Parse(nhRegisterInfo.DiagNo), 1, nhBalance.DayCount, nhBalance.OutDate.ToString("yyyy-MM-dd HH:mm:ss"), nhBalance.JsDate.ToString("yyyy-MM-dd HH:mm:ss"), "1", sb); if (iHr < 0) { throw new Exception(string.Format(@"结算错误:{0}", sb.ToString())); } hrPreClearing = sb.ToString(); } hisTrans.Commit(); //实际结算工作已成功,做结算的后处理;;;update wynhbalance表,如果是异地还需要数据回写当地和管办服务器 if (nhRegisterInfo != null && nhBalance != null) { //update 结算信息; nhBalance.TotalFee = hrPreClearing.TotalFee; nhBalance.ReimRangeFee = hrPreClearing.ReimRangeFee; nhBalance.ReimFee = hrPreClearing.ReimFee; nhBalance.HospitalReduction = hrPreClearing.HospitalReduction; nhBalance.CivilPay = hrPreClearing.CivilPay; nhBalance.ScAmount = hrPreClearing.ScAmount; nhBalance.HospitalCost = hrPreClearing.HospitalCost; nhBalance.BeginLimite = hrPreClearing.BeginLimite; nhBalance.SpecialIllHospitalCost = hrPreClearing.SpecialIllHospitalCost; nhBalance.YearLimite = hrPreClearing.YearLimite; nhBalance.YearTotalReimFee = hrPreClearing.YearTotalReimFee; hisDb.SubmitChanges(); //如果是异地则回写当地和管办服务器 if (nhRegisterInfo.OrganCode == GSettings.OrganIDRemote) { sb = new StringBuilder(500); iHr = NhLocalWrap.zzGetDataBack(GSettings.ParamRemoteOrganID, nhRegisterInfo.AreaCode, nhRegisterInfo.CoopMedCode, nhRegisterInfo.AiIDNo, Convert.ToInt32(nhRegisterInfo.DiagNo), nhRegisterInfo.ExpressionID, sb); if (iHr < 0) { throw new Exception(string.Format(@"异地农合回写错误:{0}", sb.ToString())); } } } } catch (System.Exception ex) { hr = ex.Message; try { hisTrans.Rollback(); } catch (System.Exception exx) { Console.WriteLine("roll back Error" + exx.Message); } } finally { hisConn.Close(); } return(hr); }
public HRESULT put_Size(CY size) { return(((delegate * unmanaged <IFont *, CY, int>)(lpVtbl[6]))((IFont *)Unsafe.AsPointer(ref this), size)); }
/// <summary> /// Validates VAT number /// </summary> /// <returns>Corrected VAT number in VatNumber object</returns> public static VatNumber Validate(string vat, EUCountry euCountry) { string countryCode = euCountry.ToString().ToUpper(); vat = vat.ToUpper(); CountryBase countryBase; switch (euCountry) { case EUCountry.AT: countryBase = new AT(); break; case EUCountry.BE: countryBase = new BE(); break; case EUCountry.BG: countryBase = new BG(); break; case EUCountry.CY: countryBase = new CY(); break; case EUCountry.CZ: countryBase = new CZ(); break; case EUCountry.DE: countryBase = new DE(); break; case EUCountry.DK: countryBase = new DK(); break; case EUCountry.EE: countryBase = new EE(); break; case EUCountry.EL: countryBase = new EL(); break; case EUCountry.ES: countryBase = new ES(); break; case EUCountry.FI: countryBase = new FI(); break; case EUCountry.FR: countryBase = new FR(); break; case EUCountry.GB: countryBase = new GB(); break; case EUCountry.HR: countryBase = new HR(); break; case EUCountry.HU: countryBase = new HU(); break; case EUCountry.IE: countryBase = new IE(); break; case EUCountry.IT: countryBase = new IT(); break; case EUCountry.LT: countryBase = new LT(); break; case EUCountry.LU: countryBase = new LU(); break; case EUCountry.LV: countryBase = new LV(); break; case EUCountry.MT: countryBase = new MT(); break; case EUCountry.NL: countryBase = new NL(); break; case EUCountry.PL: countryBase = new PL(); break; case EUCountry.PT: countryBase = new PT(); break; case EUCountry.RO: countryBase = new RO(); break; case EUCountry.SE: countryBase = new SE(); break; case EUCountry.SI: countryBase = new SI(); break; case EUCountry.SK: countryBase = new SK(); break; default: throw new InvalidCountryException(); } if (countryBase.StripLetters) { return(new VatNumber(euCountry, countryBase.Validate(Strip(vat)))); } return(new VatNumber(euCountry, countryBase.Validate(StripNoLetters(vat, countryCode)))); }