コード例 #1
0
ファイル: QAService.cs プロジェクト: qubianzhong/luckysign
        public ReturnValue <PageInfo <QA_QuestionShowMini <AstroMod> > > GetQuestionListForAstro(int pagesize, int pageindex, string key, int cate, string orderby)
        {
            int       total = 0;
            DataTable m_dt  = QA_QuestionBll.GetInstance().GetList(pagesize, pageindex, key, cate, orderby, ref total);
            List <QA_QuestionShowMini <AstroMod> >     ret  = new List <QA_QuestionShowMini <AstroMod> >();
            PageInfo <QA_QuestionShowMini <AstroMod> > rett = new PageInfo <QA_QuestionShowMini <AstroMod> >();

            if (m_dt == null || m_dt.Rows.Count == 0)
            {
                rett.List        = ret;
                rett.Total       = total;
                rett.HasNextPage = false;
                return(ReturnValue <PageInfo <QA_QuestionShowMini <AstroMod> > > .Get200OK(rett));
            }
            for (int i = 0; i < m_dt.Rows.Count; i++)
            {
                QA_QuestionShowMini <AstroMod> tmp_quest = MapQA_QuestionShowMiniForAstro(m_dt.Rows[i]);
                ret.Add(tmp_quest);
            }

            rett.List  = ret;
            rett.Total = total;
            if (pagesize * pageindex >= total)
            {
                rett.HasNextPage = false;
            }
            else
            {
                rett.HasNextPage = true;
            }
            return(ReturnValue <PageInfo <QA_QuestionShowMini <AstroMod> > > .Get200OK(rett));
        }
コード例 #2
0
ファイル: QAService.cs プロジェクト: Kjubo/luckysign
        public QA_QuestionShowMini<ZiWeiMod> MapQA_QuestionShowMiniForZiWei(DataRow input)
        {
            QA_QuestionShowMini<ZiWeiMod> ret = new QA_QuestionShowMini<ZiWeiMod>();
            if (input["Award"].ToString() != "")
            {
                ret.Award = int.Parse(input["Award"].ToString());
            }
            if (input["CateSysNo"].ToString() != "")
            {
                ret.CateSysNo = int.Parse(input["CateSysNo"].ToString());
            }
            #region 设置命盘
            int[] _paras = {1,1,0,1};
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(int.Parse(input["SysNo"].ToString()));
            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
            ret.Context = input["Context"].ToString();
            if (input["NickName"] == null)
            {
                USR_CustomerMod m_customer = USR_CustomerBll.GetInstance().GetModel(int.Parse(input["CustomerSysNo"].ToString()));

                ret.CustomerNickName = m_customer.NickName;
                ret.CustomerPhoto = m_customer.Photo;
            }
            else
            {
                ret.CustomerNickName = input["NickName"].ToString();
                ret.CustomerPhoto = input["Photo"].ToString();
            }
            if (input["CustomerSysNo"].ToString() != "")
            {
                ret.CustomerSysNo = int.Parse(input["CustomerSysNo"].ToString());
            }
            ret.DR = int.Parse(input["DR"].ToString());
            if (input["EndTime"].ToString() != "")
            {
                ret.EndTime = DateTime.Parse(input["EndTime"].ToString());
            }
            if (input["IsSecret"].ToString() != "")
            {
                ret.IsSecret = int.Parse(input["IsSecret"].ToString());
            }
            if (input["LastReplyTime"].ToString() != "")
            {
                ret.LastReplyTime = DateTime.Parse(input["LastReplyTime"].ToString());
            }
            if (input["LastReplyUser"].ToString() != "")
            {
                ret.LastReplyUser = int.Parse(input["LastReplyUser"].ToString());
            }
            if (input["ReadCount"].ToString() != "")
            {
                ret.ReadCount = int.Parse(input["ReadCount"].ToString());
            }
            if (input["ReplyCount"].ToString() != "")
            {
                ret.ReplyCount = int.Parse(input["ReplyCount"].ToString());
            }
            if (input["SysNo"].ToString() != "")
            {
                ret.SysNo = int.Parse(input["SysNo"].ToString());
            }
            ret.Title = input["Title"].ToString();
            if (input["TS"].ToString() != "")
            {
                ret.TS = DateTime.Parse(input["TS"].ToString());
            }

            return ret;
        }
コード例 #3
0
ファイル: QAService.cs プロジェクト: Kjubo/luckysign
        public QA_QuestionShowMini<BaZiMod> MapQA_QuestionShowMiniForBaZi(DataRow input)
        {
            QA_QuestionShowMini<BaZiMod> ret = new QA_QuestionShowMini<BaZiMod>();
            if (input["Award"].ToString() != "")
            {
                ret.Award = int.Parse(input["Award"].ToString());
            }
            if (input["CateSysNo"].ToString() != "")
            {
                ret.CateSysNo = int.Parse(input["CateSysNo"].ToString());
            }
            #region 设置命盘
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(int.Parse(input["SysNo"].ToString()));
            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
            ret.Context = input["Context"].ToString();
            if (input["NickName"] == null)
            {
                USR_CustomerMod m_customer = USR_CustomerBll.GetInstance().GetModel(int.Parse(input["CustomerSysNo"].ToString()));

                ret.CustomerNickName = m_customer.NickName;
                ret.CustomerPhoto = m_customer.Photo;
            }
            else
            {
                ret.CustomerNickName = input["NickName"].ToString();
                ret.CustomerPhoto = input["Photo"].ToString();
            }
            if (input["CustomerSysNo"].ToString() != "")
            {
                ret.CustomerSysNo = int.Parse(input["CustomerSysNo"].ToString());
            }
            ret.DR = int.Parse(input["DR"].ToString());
            if (input["EndTime"].ToString() != "")
            {
                ret.EndTime = DateTime.Parse(input["EndTime"].ToString());
            }
            if (input["IsSecret"].ToString() != "")
            {
                ret.IsSecret = int.Parse(input["IsSecret"].ToString());
            }
            if (input["LastReplyTime"].ToString() != "")
            {
                ret.LastReplyTime = DateTime.Parse(input["LastReplyTime"].ToString());
            }
            if (input["LastReplyUser"].ToString() != "")
            {
                ret.LastReplyUser = int.Parse(input["LastReplyUser"].ToString());
            }
            if (input["ReadCount"].ToString() != "")
            {
                ret.ReadCount = int.Parse(input["ReadCount"].ToString());
            }
            if (input["ReplyCount"].ToString() != "")
            {
                ret.ReplyCount = int.Parse(input["ReplyCount"].ToString());
            }
            if (input["SysNo"].ToString() != "")
            {
                ret.SysNo = int.Parse(input["SysNo"].ToString());
            }
            ret.Title = input["Title"].ToString();
            if (input["TS"].ToString() != "")
            {
                ret.TS = DateTime.Parse(input["TS"].ToString());
            }

            return ret;
        }
コード例 #4
0
ファイル: QAService.cs プロジェクト: Kjubo/luckysign
        public QA_QuestionShowMini<AstroMod> MapQA_QuestionShowMiniForAstro(DataRow input)
        {
            QA_QuestionShowMini<AstroMod> ret = new QA_QuestionShowMini<AstroMod>();

            if (input["Award"].ToString() != "")
            {
                ret.Award = int.Parse(input["Award"].ToString());
            }
            if (input["CateSysNo"].ToString() != "")
            {
                ret.CateSysNo = int.Parse(input["CateSysNo"].ToString());
            }
            #region 设置星盘
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(int.Parse(input["SysNo"].ToString()));
            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
            ret.Context = input["Context"].ToString();
            if (input["NickName"] == null)
            {
                USR_CustomerMod m_customer = USR_CustomerBll.GetInstance().GetModel(int.Parse(input["CustomerSysNo"].ToString()));

                ret.CustomerNickName = m_customer.NickName;
                ret.CustomerPhoto = m_customer.Photo;
            }
            else
            {
                ret.CustomerNickName = input["NickName"].ToString();
                ret.CustomerPhoto = input["Photo"].ToString();
            }
            if (input["CustomerSysNo"].ToString() != "")
            {
                ret.CustomerSysNo = int.Parse(input["CustomerSysNo"].ToString());
            }
            ret.DR = int.Parse(input["DR"].ToString());
            if (input["EndTime"].ToString() != "")
            {
                ret.EndTime = DateTime.Parse(input["EndTime"].ToString());
            }
            else
            {
                ret.EndTime = AppConst.DateTimeNull;
            }
            if (input["IsSecret"].ToString() != "")
            {
                ret.IsSecret = int.Parse(input["IsSecret"].ToString());
            }
            if (input["LastReplyTime"].ToString() != "")
            {
                ret.LastReplyTime = DateTime.Parse(input["LastReplyTime"].ToString());
            }
            else
            {
                ret.LastReplyTime = AppConst.DateTimeNull;
            }
            if (input["LastReplyUser"].ToString() != "")
            {
                ret.LastReplyUser = int.Parse(input["LastReplyUser"].ToString());
            }
            if (input["ReadCount"].ToString() != "")
            {
                ret.ReadCount = int.Parse(input["ReadCount"].ToString());
            }
            if (input["ReplyCount"].ToString() != "")
            {
                ret.ReplyCount = int.Parse(input["ReplyCount"].ToString());
            }
            if (input["SysNo"].ToString() != "")
            {
                ret.SysNo = int.Parse(input["SysNo"].ToString());
            }
            ret.Title = input["Title"].ToString();
            if (input["TS"].ToString() != "")
            {
                ret.TS = DateTime.Parse(input["TS"].ToString());
            }
            else
            {
                ret.TS = AppConst.DateTimeNull;
            }
            return ret;
        }
コード例 #5
0
ファイル: QAService.cs プロジェクト: qubianzhong/luckysign
        public QA_QuestionShowMini <ZiWeiMod> MapQA_QuestionShowMiniForZiWei(DataRow input)
        {
            QA_QuestionShowMini <ZiWeiMod> ret = new QA_QuestionShowMini <ZiWeiMod>();

            if (input["Award"].ToString() != "")
            {
                ret.Award = int.Parse(input["Award"].ToString());
            }
            if (input["CateSysNo"].ToString() != "")
            {
                ret.CateSysNo = int.Parse(input["CateSysNo"].ToString());
            }
            #region 设置命盘
            int[]         _paras  = { 1, 1, 0, 1 };
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(int.Parse(input["SysNo"].ToString()));
            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
            ret.Context = input["Context"].ToString();
            if (input["NickName"] == null)
            {
                USR_CustomerMod m_customer = USR_CustomerBll.GetInstance().GetModel(int.Parse(input["CustomerSysNo"].ToString()));

                ret.CustomerNickName = m_customer.NickName;
                ret.CustomerPhoto    = m_customer.Photo;
            }
            else
            {
                ret.CustomerNickName = input["NickName"].ToString();
                ret.CustomerPhoto    = input["Photo"].ToString();
            }
            if (input["CustomerSysNo"].ToString() != "")
            {
                ret.CustomerSysNo = int.Parse(input["CustomerSysNo"].ToString());
            }
            ret.DR = int.Parse(input["DR"].ToString());
            if (input["EndTime"].ToString() != "")
            {
                ret.EndTime = DateTime.Parse(input["EndTime"].ToString());
            }
            if (input["IsSecret"].ToString() != "")
            {
                ret.IsSecret = int.Parse(input["IsSecret"].ToString());
            }
            if (input["LastReplyTime"].ToString() != "")
            {
                ret.LastReplyTime = DateTime.Parse(input["LastReplyTime"].ToString());
            }
            if (input["LastReplyUser"].ToString() != "")
            {
                ret.LastReplyUser = int.Parse(input["LastReplyUser"].ToString());
            }
            if (input["ReadCount"].ToString() != "")
            {
                ret.ReadCount = int.Parse(input["ReadCount"].ToString());
            }
            if (input["ReplyCount"].ToString() != "")
            {
                ret.ReplyCount = int.Parse(input["ReplyCount"].ToString());
            }
            if (input["SysNo"].ToString() != "")
            {
                ret.SysNo = int.Parse(input["SysNo"].ToString());
            }
            ret.Title = input["Title"].ToString();
            if (input["TS"].ToString() != "")
            {
                ret.TS = DateTime.Parse(input["TS"].ToString());
            }

            return(ret);
        }
コード例 #6
0
ファイル: QAService.cs プロジェクト: qubianzhong/luckysign
        public QA_QuestionShowMini <BaZiMod> MapQA_QuestionShowMiniForBaZi(DataRow input)
        {
            QA_QuestionShowMini <BaZiMod> ret = new QA_QuestionShowMini <BaZiMod>();

            if (input["Award"].ToString() != "")
            {
                ret.Award = int.Parse(input["Award"].ToString());
            }
            if (input["CateSysNo"].ToString() != "")
            {
                ret.CateSysNo = int.Parse(input["CateSysNo"].ToString());
            }
            #region 设置命盘
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(int.Parse(input["SysNo"].ToString()));
            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
            ret.Context = input["Context"].ToString();
            if (input["NickName"] == null)
            {
                USR_CustomerMod m_customer = USR_CustomerBll.GetInstance().GetModel(int.Parse(input["CustomerSysNo"].ToString()));

                ret.CustomerNickName = m_customer.NickName;
                ret.CustomerPhoto    = m_customer.Photo;
            }
            else
            {
                ret.CustomerNickName = input["NickName"].ToString();
                ret.CustomerPhoto    = input["Photo"].ToString();
            }
            if (input["CustomerSysNo"].ToString() != "")
            {
                ret.CustomerSysNo = int.Parse(input["CustomerSysNo"].ToString());
            }
            ret.DR = int.Parse(input["DR"].ToString());
            if (input["EndTime"].ToString() != "")
            {
                ret.EndTime = DateTime.Parse(input["EndTime"].ToString());
            }
            if (input["IsSecret"].ToString() != "")
            {
                ret.IsSecret = int.Parse(input["IsSecret"].ToString());
            }
            if (input["LastReplyTime"].ToString() != "")
            {
                ret.LastReplyTime = DateTime.Parse(input["LastReplyTime"].ToString());
            }
            if (input["LastReplyUser"].ToString() != "")
            {
                ret.LastReplyUser = int.Parse(input["LastReplyUser"].ToString());
            }
            if (input["ReadCount"].ToString() != "")
            {
                ret.ReadCount = int.Parse(input["ReadCount"].ToString());
            }
            if (input["ReplyCount"].ToString() != "")
            {
                ret.ReplyCount = int.Parse(input["ReplyCount"].ToString());
            }
            if (input["SysNo"].ToString() != "")
            {
                ret.SysNo = int.Parse(input["SysNo"].ToString());
            }
            ret.Title = input["Title"].ToString();
            if (input["TS"].ToString() != "")
            {
                ret.TS = DateTime.Parse(input["TS"].ToString());
            }

            return(ret);
        }
コード例 #7
0
ファイル: QAService.cs プロジェクト: qubianzhong/luckysign
        public QA_QuestionShowMini <AstroMod> MapQA_QuestionShowMiniForAstro(DataRow input)
        {
            QA_QuestionShowMini <AstroMod> ret = new QA_QuestionShowMini <AstroMod>();

            if (input["Award"].ToString() != "")
            {
                ret.Award = int.Parse(input["Award"].ToString());
            }
            if (input["CateSysNo"].ToString() != "")
            {
                ret.CateSysNo = int.Parse(input["CateSysNo"].ToString());
            }
            #region 设置星盘
            FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(int.Parse(input["SysNo"].ToString()));
            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
            ret.Context = input["Context"].ToString();
            if (input["NickName"] == null)
            {
                USR_CustomerMod m_customer = USR_CustomerBll.GetInstance().GetModel(int.Parse(input["CustomerSysNo"].ToString()));

                ret.CustomerNickName = m_customer.NickName;
                ret.CustomerPhoto    = m_customer.Photo;
            }
            else
            {
                ret.CustomerNickName = input["NickName"].ToString();
                ret.CustomerPhoto    = input["Photo"].ToString();
            }
            if (input["CustomerSysNo"].ToString() != "")
            {
                ret.CustomerSysNo = int.Parse(input["CustomerSysNo"].ToString());
            }
            ret.DR = int.Parse(input["DR"].ToString());
            if (input["EndTime"].ToString() != "")
            {
                ret.EndTime = DateTime.Parse(input["EndTime"].ToString());
            }
            else
            {
                ret.EndTime = AppConst.DateTimeNull;
            }
            if (input["IsSecret"].ToString() != "")
            {
                ret.IsSecret = int.Parse(input["IsSecret"].ToString());
            }
            if (input["LastReplyTime"].ToString() != "")
            {
                ret.LastReplyTime = DateTime.Parse(input["LastReplyTime"].ToString());
            }
            else
            {
                ret.LastReplyTime = AppConst.DateTimeNull;
            }
            if (input["LastReplyUser"].ToString() != "")
            {
                ret.LastReplyUser = int.Parse(input["LastReplyUser"].ToString());
            }
            if (input["ReadCount"].ToString() != "")
            {
                ret.ReadCount = int.Parse(input["ReadCount"].ToString());
            }
            if (input["ReplyCount"].ToString() != "")
            {
                ret.ReplyCount = int.Parse(input["ReplyCount"].ToString());
            }
            if (input["SysNo"].ToString() != "")
            {
                ret.SysNo = int.Parse(input["SysNo"].ToString());
            }
            ret.Title = input["Title"].ToString();
            if (input["TS"].ToString() != "")
            {
                ret.TS = DateTime.Parse(input["TS"].ToString());
            }
            else
            {
                ret.TS = AppConst.DateTimeNull;
            }
            return(ret);
        }