//#endregion public void Initial() { MyCalendar m_c = new MyCalendar(); DateEntity tmp = new DateEntity(); tmp._date = this._date; m_c.SetDateEntity(ref tmp); this._BeginMonth = tmp._BeginMonth; this._BeginZodiac = tmp._BeginZodiac; this.nonglimonth = tmp.nonglimonth; this.nongliday = tmp.nongliday; this.nonglihour = tmp.nonglihour; this.nongliyearflag = tmp.nongliyearflag; this.NongliMonthDays = tmp.NongliMonthDays; if (nongliyearflag) { BaZi.BaZiBiz m_bz = PPLive.BaZi.BaZiBiz.GetInstance(); this.nongliTG = m_bz.YearTG(_date.Year - 1); this.nongliDZ = m_bz.YearDZ(_date.Year - 1); } else { BaZi.BaZiBiz m_bz = PPLive.BaZi.BaZiBiz.GetInstance(); this.nongliTG = m_bz.YearTG(_date.Year); this.nongliDZ = m_bz.YearDZ(_date.Year); } }
public static BaZiBiz GetInstance() { if (_instance == null) { _instance = new BaZiBiz(); } return(_instance); }
public static BaZiBiz GetInstance() { if (_instance == null) { _instance = new BaZiBiz(); } return _instance; }
public string BaziToHTML(BaZiMod bazi, bool all) { string ret = ""; int dayun = 8; ret += b("姓名:") + bazi.Name + " " + b("排盘类型:"); if (bazi.RealTime) { ret += "真太阳时"; } else { ret += "普通排盘"; } ret += "<br />"; if (bazi.RealTime) { ret += b("出生地:") + bazi.AreaName + " " + b("经度:") + bazi.Longitude + "<br />"; } ret += "上上签神秘学社区四柱八字排盘系统 <a href='" + AppCmn.AppConfig.HomeUrl() + "'>" + AppCmn.AppConfig.HomeUrl() + "</a><br /><br />"; ret += b("公历:") + fa(bazi.BirthTime.Date.Year.ToString("0000")) + "年" + fa(bazi.BirthTime.Date.Month.ToString("00")) + "月" + fa(bazi.BirthTime.Date.Day.ToString("00")) + "日" + fa(bazi.BirthTime.Date.Hour.ToString("00")) + "时" + fa(bazi.BirthTime.Date.Minute.ToString("00")) + "分" + "<br />"; ret += b("阴历:") + PublicValue.GetTianGan(bazi.BirthTime.NongliTG) + PublicValue.GetDiZhi(bazi.BirthTime.NongliDZ) + "年[" + PublicValue.GetNayin(10000 + (int)bazi.BirthTime.NongliTG * 100 + (int)bazi.BirthTime.NongliDZ) + "]" + PublicValue.GetNongliMonth(bazi.BirthTime.NongliMonth) + "月" + PublicValue.GetNongliDay(bazi.BirthTime.NongliDay) + PublicValue.GetDiZhi(bazi.BirthTime.NongliHour) + "时<br /><br />"; ret += PublicValue.GetAllJieQi(bazi.JieQiName[0]) + ":" + fa(bazi.JieQi[0].Year.ToString("0000")) + "年" + fa(bazi.JieQi[0].Month.ToString("00")) + "月" + fa(bazi.JieQi[0].Day.ToString("00")) + "日" + fa(bazi.JieQi[0].Hour.ToString("00")) + "时" + fa(bazi.JieQi[0].Minute.ToString("00")) + "分" + fa(bazi.JieQi[0].Second.ToString("00")) + "秒" + " (高精度天文算法)<br />"; ret += PublicValue.GetAllJieQi(bazi.JieQiName[1]) + ":" + fa(bazi.JieQi[1].Year.ToString("0000")) + "年" + fa(bazi.JieQi[1].Month.ToString("00")) + "月" + fa(bazi.JieQi[1].Day.ToString("00")) + "日" + fa(bazi.JieQi[1].Hour.ToString("00")) + "时" + fa(bazi.JieQi[1].Minute.ToString("00")) + "分" + fa(bazi.JieQi[1].Second.ToString("00")) + "秒" + "<br /><br />"; ret += b("起运:") + "于出生后" + fa(bazi.QiYun.Days.ToString()) + "天" + fa(bazi.QiYun.Hours.ToString()) + "小时" + fa(bazi.QiYun.Minutes.ToString()) + "分钟起运<br />"; ret += b("交运:") + "于公历" + fa(bazi.JiaoYun.Year.ToString()) + "年" + fa(bazi.JiaoYun.Month.ToString()) + "月" + fa(bazi.JiaoYun.Day.ToString()) + "日" + fa(bazi.JiaoYun.Hour.ToString()) + "时" + fa(bazi.JiaoYun.Hour.ToString()) + "分交运<br /><br />"; ret += " " + fc(PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.YearTG, bazi.DayTG)).ShiShen)) + " " + fc(PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.MonthTG, bazi.DayTG)).ShiShen)) + " " + fc("日主") + " " + fc(PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.HourTG, bazi.DayTG)).ShiShen)) + "<br />"; if (bazi.Gender == AppCmn.AppEnum.Gender.male) { ret += b("乾造:") + " "; } else { ret += b("坤造:") + " "; } ret += fa(PublicValue.GetTianGan(bazi.YearTG)) + " " + fa(PublicValue.GetTianGan(bazi.MonthTG)) + " " + fa(PublicValue.GetTianGan(bazi.DayTG)) + " " + fa(PublicValue.GetTianGan(bazi.HourTG)) + " (" + fd(PublicValue.GetDiZhi(bazi.XunKong0)) + fd(PublicValue.GetDiZhi(bazi.XunKong1)) + "空)<br />"; ret += b(" ") + " " + fa(PublicValue.GetDiZhi(bazi.YearDZ)) + " " + fa(PublicValue.GetDiZhi(bazi.MonthDZ)) + " " + fa(PublicValue.GetDiZhi(bazi.DayDZ)) + " " + fa(PublicValue.GetDiZhi(bazi.HourDZ)) + "<br /><br />"; for (int j = 0; j < 3; j++) { ret += b(" ") + " "; for (int i = 0; i < 4; i++) { if (!(j != 0 && (int)bazi.CangGan[i, j] == 0)) { ret += PublicValue.GetTianGan(bazi.CangGan[i, j]) + fc(PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(bazi.CangGan[i, j], bazi.DayTG)).ShiShen)) + " "; } } ret += "<br />"; } ret += b("旺衰:") + " "; for (int i = 0; i < 4; i++) { ret += PublicValue.GetZiWeiChangSheng(bazi.WangShuai[i]).Replace(" ", ""); for (int j = 0; j < 4 - PublicValue.GetZiWeiChangSheng(bazi.WangShuai[i]).Replace(" ", "").Length; j++) { ret += " "; } } ret += "<br />"; ret += b("纳音:") + " "; for (int i = 0; i < 4; i++) { ret += fb(PublicValue.GetNayin(bazi.NaYin[i])) + " "; } ret += "<br /><br />"; //大运 ret += b("纳音:"); for (int i = 0; i < dayun; i++) { ret += fb(PublicValue.GetNayin(bazi.Dayun[i].NaYin)) + " "; } ret += "<br />"; ret += b("旺衰:"); for (int i = 0; i < dayun; i++) { ret += PublicValue.GetZiWeiChangSheng(bazi.Dayun[i].WangShuai).Replace(" ", ""); for (int j = 0; j < 4 - PublicValue.GetZiWeiChangSheng(bazi.Dayun[i].WangShuai).Replace(" ", "").Length; j++) { ret += " "; } } ret += "<br />"; ret += b("十神:"); for (int i = 0; i < dayun; i++) { ret += fc(PublicValue.GetShiShen(bazi.Dayun[i].ShiShen)) + " "; } ret += "<br />"; ret += b("大运:"); for (int i = 0; i < dayun; i++) { ret += fa(PublicValue.GetTianGan(bazi.Dayun[i].YearTG) + PublicValue.GetDiZhi(bazi.Dayun[i].YearDZ)) + " "; } ret += "<br />"; ret += b(" "); for (int i = 0; i < dayun; i++) { ret += bazi.Dayun[i].Begin - bazi.BirthTime.Date.Year + "岁 "; } ret += "<br />"; //流年 if (all) { ret += b("始于:"); for (int i = 0; i < dayun; i++) { ret += fc(bazi.Dayun[i].Begin.ToString("")) + " "; } ret += "<br />"; ret += b("流年:"); for (int i = 0; i < 10; i++) { if (i != 0) { ret += b(" "); } for (int j = 0; j < dayun; j++) { ret += PublicValue.GetTianGan(BaZiBiz.GetInstance().YearTG(bazi.Dayun[j].Begin + i)) + PublicValue.GetDiZhi(BaZiBiz.GetInstance().YearDZ(bazi.Dayun[j].Begin + i)).Replace(PublicValue.GetDiZhi(bazi.XunKong0), fd(PublicValue.GetDiZhi(bazi.XunKong0))).Replace(PublicValue.GetDiZhi(bazi.XunKong1), fd(PublicValue.GetDiZhi(bazi.XunKong1))) + " "; } ret += "<br />"; } ret += b("止于:"); for (int i = 0; i < dayun; i++) { ret += fc(bazi.Dayun[i].End.ToString()) + " "; } ret += "<br />"; } return(ret); }