public ReturnValue <QA_QuestionShow <ZiWeiMod> > GetQuestionForZiWei(int sysno) { QA_QuestionMod tmp = QA_QuestionBll.GetInstance().GetModel(sysno); QA_QuestionShow <ZiWeiMod> ret = new QA_QuestionShow <ZiWeiMod>(); tmp.MemberwiseCopy(ret); USR_CustomerShow tmpu = new USR_CustomerShow(); USR_CustomerBll.GetInstance().GetModel(ret.CustomerSysNo).MemberwiseCopy(tmpu); ret.Customer = tmpu; #region 设置命盘 int[] _paras = { 1, 1, 0, 1 }; FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(ret.SysNo); if (m_chart != null) { ZiWeiMod m_ziwei = new ZiWeiMod(); #region 设置实体各种参数 //默认做太阳时修正 string[] tmplatlng = m_chart.FirstPoi.ToString().Split(new char[] { '|' }); m_ziwei.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.FirstBirth.ToString()), new LatLng(tmplatlng[1], tmplatlng[0], m_chart.FirstPoiName))); m_ziwei.Gender = (AppEnum.Gender) int.Parse(m_chart.FirstGender.ToString()); m_ziwei.RunYue = PublicValue.ZiWeiRunYue.dangxia; m_ziwei.TransitTime = new DateEntity(DateTime.Now); #endregion m_ziwei = ZiWeiBiz.GetInstance().TimeToZiWei(m_ziwei.BirthTime, m_ziwei.Gender, _paras); ret.Chart.Add(m_ziwei); if (m_chart.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString()) { ZiWeiMod m_ziwei1 = new ZiWeiMod(); #region 设置实体各种参数 tmplatlng = m_chart.SecondPoi.ToString().Split(new char[] { '|' }); m_ziwei1.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.SecondBirth.ToString()), new LatLng(tmplatlng[1], tmplatlng[0], m_chart.SecondPoiName))); m_ziwei1.Gender = (AppEnum.Gender) int.Parse(m_chart.SecondGender.ToString()); m_ziwei1.RunYue = PublicValue.ZiWeiRunYue.dangxia; m_ziwei1.TransitTime = new DateEntity(DateTime.Now); #endregion m_ziwei1 = ZiWeiBiz.GetInstance().TimeToZiWei(m_ziwei.BirthTime, m_ziwei.Gender, _paras); ret.Chart.Add(m_ziwei1); } } #endregion return(ReturnValue <QA_QuestionShow <ZiWeiMod> > .Get200OK(ret)); }
public ReturnValue <QA_QuestionShow <BaZiMod> > GetQuestionForBaZi(int sysno) { QA_QuestionMod tmp = QA_QuestionBll.GetInstance().GetModel(sysno); QA_QuestionShow <BaZiMod> ret = new QA_QuestionShow <BaZiMod>(); tmp.MemberwiseCopy(ret); USR_CustomerShow tmpu = new USR_CustomerShow(); USR_CustomerBll.GetInstance().GetModel(ret.CustomerSysNo).MemberwiseCopy(tmpu); ret.Customer = tmpu; #region 设置命盘 FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(ret.SysNo); if (m_chart != null) { BaZiMod m_bazi = new BaZiMod(); string[] tmplatlng = m_chart.FirstPoi.ToString().Split(new char[] { '|' }); m_bazi.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.FirstBirth.ToString()), new LatLng(tmplatlng[1], tmplatlng[0], m_chart.FirstPoiName))); m_bazi.AreaName = m_chart.FirstPoiName.ToString(); m_bazi.Longitude = tmplatlng[0]; m_bazi.Gender = (AppEnum.Gender)m_chart.FirstGender; BaZiBiz.GetInstance().TimeToBaZi(ref m_bazi); ret.Chart.Add(m_bazi); if (m_chart.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString()) { BaZiMod m_bazi1 = new BaZiMod(); tmplatlng = m_chart.SecondPoi.ToString().Split(new char[] { '|' }); m_bazi1.BirthTime = new DateEntity(PublicDeal.GetInstance().RealTime(DateTime.Parse(m_chart.SecondBirth.ToString()), new LatLng(tmplatlng[1], tmplatlng[0], m_chart.SecondPoiName))); m_bazi1.AreaName = m_chart.SecondPoiName.ToString(); m_bazi1.Longitude = tmplatlng[0]; m_bazi1.Gender = (AppEnum.Gender)m_chart.SecondGender; BaZiBiz.GetInstance().TimeToBaZi(ref m_bazi1); ret.Chart.Add(m_bazi1); } } #endregion return(ReturnValue <QA_QuestionShow <BaZiMod> > .Get200OK(ret)); }
public ReturnValue <QA_QuestionShow <AstroMod> > GetQuestionForAstro(int sysno) { QA_QuestionMod tmp = QA_QuestionBll.GetInstance().GetModel(sysno); QA_QuestionShow <AstroMod> ret = new QA_QuestionShow <AstroMod>(); tmp.MemberwiseCopy(ret); USR_CustomerShow tmpu = new USR_CustomerShow(); USR_CustomerBll.GetInstance().GetModel(ret.CustomerSysNo).MemberwiseCopy(tmpu); ret.Customer = tmpu; #region 设置星盘 FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(ret.SysNo); if (m_chart != null) { AstroMod tmpastro = new AstroMod(); if (m_chart.CharType.ToString() == ((int)AppEnum.ChartType.personal).ToString()) { #region 设置实体各种参数 tmpastro.type = PublicValue.AstroType.benming; tmpastro.birth = DateTime.Parse(m_chart.FirstBirth.ToString()); tmpastro.Gender = (AppEnum.Gender)m_chart.FirstGender; string[] tmplatlng = m_chart.FirstPoi.ToString().Split(new char[] { '|' }); tmpastro.position = new LatLng(tmplatlng[1], tmplatlng[0], m_chart.FirstPoiName); if (m_chart.FirstDayLight.ToString() == ((int)AppEnum.BOOL.True).ToString()) { tmpastro.IsDayLight = AppEnum.BOOL.True; } else { tmpastro.IsDayLight = AppEnum.BOOL.False; } tmpastro.zone = int.Parse(m_chart.FirstTimeZone.ToString()); #endregion } else if (m_chart.CharType.ToString() == ((int)AppEnum.ChartType.relation).ToString()) { #region 设置实体各种参数 tmpastro.type = PublicValue.AstroType.hepan; tmpastro.compose = PublicValue.AstroZuhe.bijiao; tmpastro.Gender = (AppEnum.Gender)m_chart.FirstGender; tmpastro.Gender1 = (AppEnum.Gender)m_chart.SecondGender; tmpastro.birth = DateTime.Parse(m_chart.FirstBirth.ToString()); string[] tmplatlng = m_chart.FirstPoi.ToString().Split(new char[] { '|' }); tmpastro.position = new LatLng(tmplatlng[1], tmplatlng[0], m_chart.FirstPoiName); if (m_chart.FirstDayLight.ToString() == ((int)AppEnum.BOOL.True).ToString()) { tmpastro.IsDayLight = AppEnum.BOOL.True; } else { tmpastro.IsDayLight = AppEnum.BOOL.False; } tmpastro.zone = int.Parse(m_chart.FirstTimeZone.ToString()); tmpastro.birth1 = DateTime.Parse(m_chart.SecondBirth.ToString()); tmplatlng = m_chart.SecondPoi.ToString().Split(new char[] { '|' }); tmpastro.position1 = new LatLng(tmplatlng[1], tmplatlng[0], m_chart.SecondPoiName); if (m_chart.SecondDayLight.ToString() == ((int)AppEnum.BOOL.True).ToString()) { tmpastro.IsDayLight1 = AppEnum.BOOL.True; } else { tmpastro.IsDayLight1 = AppEnum.BOOL.False; } tmpastro.zone1 = int.Parse(m_chart.SecondTimeZone.ToString()); #endregion } tmpastro.startsShow.Clear(); for (int i = 1; i <= 30; i++) { tmpastro.startsShow.Add(i, PublicValue.GetAstroStar((PublicValue.AstroStar)i)); } tmpastro.aspectsShow.Clear(); tmpastro.aspectsShow.Add(1, 0); tmpastro.aspectsShow.Add(2, 180); tmpastro.aspectsShow.Add(4, 120); tmpastro.aspectsShow.Add(3, 90); tmpastro.aspectsShow.Add(5, 60); tmpastro.graphicID = AstroBiz.GetInstance().SetGraphicID(tmpastro); if ((tmpastro.type == PublicValue.AstroType.hepan && tmpastro.compose == PublicValue.AstroZuhe.bijiao) || (tmpastro.type == PublicValue.AstroType.tuiyun && tmpastro.transit == PublicValue.AstroTuiyun.xingyun)) { AstroMod tmpinput = new AstroMod(); tmpinput.aspectsShow = tmpastro.aspectsShow; tmpinput.startsShow = tmpastro.startsShow; tmpinput.birth = tmpastro.birth; tmpinput.position = tmpastro.position; tmpinput.IsDayLight = tmpastro.IsDayLight; tmpinput.zone = tmpastro.zone; AstroBiz.GetInstance().GetParamters(ref tmpinput); tmpastro.Stars = tmpinput.Stars; tmpinput = new AstroMod(); tmpinput.aspectsShow = tmpastro.aspectsShow; tmpinput.startsShow = tmpastro.startsShow; tmpinput.birth = tmpastro.birth1; tmpinput.position = tmpastro.position1; tmpinput.IsDayLight = tmpastro.IsDayLight1; tmpinput.zone = tmpastro.zone1; AstroBiz.GetInstance().GetParamters(ref tmpinput); tmpastro.Stars1 = tmpinput.Stars; } else { AstroBiz.GetInstance().GetParamters(ref tmpastro); tmpastro.Stars1 = null; } ret.Chart.Add(tmpastro); } #endregion return(ReturnValue <QA_QuestionShow <AstroMod> > .Get200OK(ret)); }