Esempio n. 1
0
        protected void BindList()
        {
            int total = 0;

            if (m_qustion.CustomerSysNo == AppConst.IntNull)
            {
                m_qustion = QA_QuestionBll.GetInstance().GetModel(SysNo);
            }
            DataTable m_dt = QA_AnswerBll.GetInstance().GetListByQuest(pagesize, pageindex, SysNo, ref total);

            Repeater1.DataSource = m_dt;
            Repeater1.DataBind();
            Pager1.url         = AppConfig.HomeUrl() + "Quest/Question/" + SysNo + "/";
            Pager1.totalrecord = total;
            if (total % AppConst.PageSize == 0)
            {
                this.Pager1.total = total / pagesize;
            }
            else
            {
                this.Pager1.total = total / pagesize + 1;
            }
            this.Pager1.index    = pageindex;
            this.Pager1.numlenth = 3;
            if (IsPostBack)
            {
                UpdatePanel1.Update();
            }
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        public ReturnValue <QA_QuestionShow <AstroMod> > SetAward(int answersysno, int score, string msg)
        {
            QA_AnswerMod m_anser = QA_AnswerBll.GetInstance().GetModel(answersysno);

            QA_AnswerBll.GetInstance().SetAward(m_anser, QA_QuestionBll.GetInstance().GetModel(m_anser.QuestionSysNo), score);

            return(GetQuestionForAstro(m_anser.SysNo));
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        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));
        }
Esempio n. 6
0
        protected void BindData()
        {
            try
            {
                if (m_qustion.DR != (int)AppEnum.State.normal)
                {
                    ShowError("");
                }
                m_qustion.ReadCount++;
                QA_QuestionBll.GetInstance().Update(m_qustion);

                ltrTitle.Text   = m_qustion.Title;
                ltrContext.Text = m_qustion.Context;
                ltrAward.Text   = m_qustion.Award.ToString();
                ltrReply.Text   = m_qustion.ReplyCount.ToString();
                ltrTime.Text    = m_qustion.TS.ToString("yyyy-MM-dd HH:mm:ss");
                ltrViewNum.Text = m_qustion.ReadCount.ToString();
                if (GetSession().CustomerEntity.SysNo == m_qustion.CustomerSysNo)
                {
                    LinkButton5.Style["display"] = "";
                    ltrTime.Text += "&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;";
                }
                USR_CustomerMod m_user  = USR_CustomerBll.GetInstance().GetModel(m_qustion.CustomerSysNo);
                USR_GradeMod    m_grade = USR_GradeBll.GetInstance().GetModel(m_user.GradeSysNo);
                ltrNickName.Text   = m_user.NickName;
                ltrQALevel.Text    = m_grade.Name;
                ltrTotalReply.Text = m_user.TotalReply.ToString();
                ltrTotalAsk.Text   = m_user.TotalQuest.ToString();
                Image1.ImageUrl    = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=t&id=" + m_user.Photo;

                #region 显示命盘
                FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(SysNo);
                if (m_chart != null && m_chart.SysNo != AppConst.IntNull)
                {
                    if (GetSession().CustomerEntity == null || GetSession().CustomerEntity.SysNo == AppConst.IntNull)
                    {
                        Astro1.input   = m_chart;
                        Astro1.Visible = true;
                    }
                    else if (GetSession().CustomerEntity.FateType == (int)AppEnum.FateType.ziwei)
                    {
                        Ziwei1.input   = m_chart;
                        Ziwei1.Visible = true;
                    }
                    else if (GetSession().CustomerEntity.FateType == (int)AppEnum.FateType.bazi)
                    {
                        Bazi1.input   = m_chart;
                        Bazi1.Visible = true;
                    }
                    else
                    {
                        Astro1.input   = m_chart;
                        Astro1.Visible = true;
                    }
                }
                #endregion

                BindList();
            }
            catch
            {
                ShowError("");
            }
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WebForMain.Master.Main m_master = (WebForMain.Master.Main)Master;
            m_master.SetTab(1);
            if (Request.QueryString["id"] != null)
            {
                try
                {
                    SysNo     = int.Parse(Request.QueryString["id"]);
                    m_qustion = QA_QuestionBll.GetInstance().GetModel(SysNo);
                    //DataBind();
                }
                catch
                {
                    ShowError("");
                }
            }
            else if (Page.RouteData.Values["id"] != null && Page.RouteData.Values["id"].ToString() != "")
            {
                try
                {
                    SysNo     = int.Parse(Page.RouteData.Values["id"].ToString());
                    m_qustion = QA_QuestionBll.GetInstance().GetModel(SysNo);
                    //DataBind();
                }
                catch
                {
                    ShowError("");
                }
            }
            else
            {
                ShowError("");
            }

            if (m_qustion.CateSysNo != 17)//不是付费咨询则弹出
            {
                ShowError("");
            }

            if (Request.QueryString["pn"] != null)
            {
                try
                {
                    pageindex = int.Parse(Request.QueryString["pn"]);
                }
                catch
                { }
            }
            else if (Page.RouteData.Values["pn"] != null && Page.RouteData.Values["pn"].ToString() != "")
            {
                try
                {
                    pageindex = int.Parse(Page.RouteData.Values["pn"].ToString());
                }
                catch
                {
                    ShowError("");
                }
            }
            if (!IsPostBack)
            {
                BindData();
            }
            #region 登录状态判断
            if (GetSession().CustomerEntity == null || GetSession().CustomerEntity.SysNo == AppConst.IntNull)
            {
                nologin.Style["display"] = "";
                txtReply2.Enabled        = false;
                Button3.Style["display"] = "none";
                IsLogined.Value          = "FALSE";
                Image2.ImageUrl          = AppConfig.WebResourcesPath() + "Images/tx_03.jpg";
            }
            else
            {
                nologin.Style["display"] = "none";
                txtReply2.Enabled        = true;
                Button3.Style["display"] = "";
                Image2.ImageUrl          = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=t&id=" + GetSession().CustomerEntity.Photo;
                IsLogined.Value          = "TRUE";
            }
            #endregion
            Right1.showsearch = false;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SetDocument", "SetDocument();", true);
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "SetDocument", "SetDocument();", true);
        }
Esempio n. 8
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            Login(Request.Url.ToString());
            if (e.CommandName == "Love")
            {
                if (!CheckCommentCookies(int.Parse(e.CommandArgument.ToString())))
                {
                    QA_AnswerMod m_answer = QA_AnswerBll.GetInstance().GetModel(int.Parse(e.CommandArgument.ToString()));
                    m_answer.Love++;
                    QA_AnswerBll.GetInstance().Update(m_answer);
                    SetCommentCookies(int.Parse(e.CommandArgument.ToString()));
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "addlove", "alert('您对该回答表示了赞同!');", true);
                    BindList();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "addlove", "alert('您已对该回答发表了看法!');", true);
                }
            }
            else if (e.CommandName == "Hate")
            {
                if (!CheckCommentCookies(int.Parse(e.CommandArgument.ToString())))
                {
                    QA_AnswerMod m_answer = QA_AnswerBll.GetInstance().GetModel(int.Parse(e.CommandArgument.ToString()));
                    m_answer.Hate++;
                    QA_AnswerBll.GetInstance().Update(m_answer);
                    SetCommentCookies(int.Parse(e.CommandArgument.ToString()));
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "addhate", "alert('您对该回答表示了不赞同!');", true);
                    BindList();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "addlove", "alert('您已对该回答发表了看法!');", true);
                }
            }
            //else if (e.CommandName == "Award")
            //{
            //    QA_QuestionMod m_quest = QA_QuestionBll.GetInstance().GetModel(SysNo);
            //    int usedAward = QA_AnswerBll.GetInstance().GetUsedAward(SysNo);
            //    ltrMax.Text = "该问题的总悬赏积分为:" + (m_quest.Award - usedAward).ToString();
            //    HiddenField1.Value = e.CommandArgument.ToString();
            //    ModalPopupExtender1.Show();
            //}
            else if (e.CommandName == "Reply")
            {
                if (((TextBox)e.Item.FindControl("txtRe")).Text.Trim() == "")
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "addComment", "alert('请输入您的回复信息!');", true);
                    return;
                }
                try
                {
                    QA_CommentMod m_comment = new QA_CommentMod();
                    m_comment.AnswerSysNo   = int.Parse(e.CommandArgument.ToString());
                    m_comment.Context       = AppCmn.CommonTools.SystemInputFilter(((TextBox)e.Item.FindControl("txtRe")).Text.Trim());
                    m_comment.DR            = (int)AppEnum.State.normal;
                    m_comment.QuestionSysNo = SysNo;
                    m_comment.TS            = DateTime.Now;
                    m_comment.CustomerSysNo = GetSession().CustomerEntity.SysNo;
                    QA_CommentBll.GetInstance().AddComment(m_comment);
                    RefreshSession();
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "addComment", "alert('发表看法成功!');", true);
                }
                catch
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "addComment", "alert('系统故障,请联系管理员');", true);
                }
                BindList();
            }
            else if (e.CommandName == "Del")
            {
                QA_AnswerMod m_answer = QA_AnswerBll.GetInstance().GetModel(int.Parse(e.CommandArgument.ToString()));
                m_answer.DR = (int)AppEnum.State.deleted;
                QA_AnswerBll.GetInstance().Update(m_answer);
                ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "addhate", "alert('成功删除该回答!');", true);
                BindList();
            }
            else if (e.CommandName == "buy")
            {
                //生成订单
                QA_OrderMod m_order = QA_OrderBll.GetInstance().GetModel(int.Parse(e.CommandArgument.ToString()));
                ORD_CashMod m_mod   = new ORD_CashMod();
                m_mod.CustomerSysNo = GetSession().CustomerEntity.SysNo;
                m_mod.CurrentID     = "";
                m_mod.Discount      = 0;

                m_mod.PayAmount    = m_order.Price;
                m_mod.PayType      = AppConst.IntNull;
                m_mod.Price        = m_order.Price;
                m_mod.ProductSysNo = m_order.SysNo;
                m_mod.Status       = (int)AppEnum.CashOrderStatus.beforepay;
                m_mod.ProductType  = (int)AppEnum.CashOrderType.consultpay;;
                m_mod.TS           = DateTime.Now;

                m_mod.OrderID = "C" + m_mod.ProductType.ToString("0") + m_mod.TS.ToString("yyyyMMdd") + m_mod.ProductSysNo + CommonTools.ThrowRandom(0, 99999).ToString("00000");
                m_mod.SysNo   = ORD_CashBll.GetInstance().Add(m_mod);
                //m_qustion.BuyCount++;//支付成功后修改订单购买数
                QA_QuestionBll.GetInstance().Update(m_qustion);

                Response.Redirect(AppConfig.HomeUrl() + "Order/ConsultOrder.aspx?order=" + m_mod.SysNo);
            }
            else if (e.CommandName == "score")
            {
                string score = ((HiddenField)e.Item.FindControl("HiddenField3")).Value;
                if (score == "")
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "score", "alert('请先选择评价!');", true);
                    return;
                }
                else
                {
                    QA_OrderMod m_order = QA_OrderBll.GetInstance().GetModel(int.Parse(e.CommandArgument.ToString()));
                    m_order.Score  = int.Parse(score);
                    m_order.Status = (int)AppEnum.ConsultOrderStatus.confirmed;
                    QA_OrderBll.GetInstance().Update(m_order);
                    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "score", "alert('已评价成功!');", true);
                    BindList();
                }
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 任务实体
        /// </summary>
        /// <param name="lastExecuteTime"></param>
        public override void Execute(DateTime?lastExecuteTime)
        {
            try
            {
                LogService.Info("任务开始", LogInfoCategory);

                DataTable m_dt = QA_QuestionBll.GetInstance().GetToEndList();
                if (m_dt != null && m_dt.Rows.Count > 0)
                {
                    int total = 0;
                    for (int i = 0; i < m_dt.Rows.Count; i++)
                    {
                        int       sysno    = int.Parse(m_dt.Rows[i]["sysno"].ToString());
                        DataTable m_answer = QA_AnswerBll.GetInstance().GetListByQuest(1, 10000, sysno, ref total);
                        m_answer.Columns.Add("commcount");
                        m_answer.Columns.Add("score");
                        int totalcomm  = 0;
                        int totallenth = 0;
                        int totallove  = 0;
                        int[,] tmpresult = new int[3, 2];
                        for (int j = 0; j < m_answer.Rows.Count; j++)
                        {
                            totallenth += m_answer.Rows[j]["Context"].ToString().Length;
                            totallove  += int.Parse(m_answer.Rows[j]["Love"].ToString());
                            DataTable m_comm = QA_CommentBll.GetInstance().GetListByAnswer(int.Parse(m_answer.Rows[j]["SysNo"].ToString()));
                            totalcomm += m_comm.Rows.Count;
                            m_answer.Rows[j]["commcount"] = m_comm.Rows.Count.ToString();
                            m_answer.Rows[j]["score"]     = 0;
                        }

                        for (int j = 0; j < m_answer.Rows.Count; j++)
                        {
                            double tmp = Convert.ToDouble(m_answer.Rows[j]["Context"].ToString().Length *m_answer.Rows.Count) / Convert.ToDouble(totallenth);
                            tmp -= 1;
                            if (tmp > 0)
                            {
                                m_answer.Rows[j]["score"] = int.Parse(m_answer.Rows[j]["score"].ToString()) + Math.Floor(tmp * 10) * Math.Floor(tmp * 10) * 10;
                            }

                            tmp  = Convert.ToDouble(m_answer.Rows[j]["Love"].ToString()) * Convert.ToDouble(m_answer.Rows.Count) / Convert.ToDouble(totallove);
                            tmp -= 1;
                            if (tmp > 0)
                            {
                                m_answer.Rows[j]["score"] = int.Parse(m_answer.Rows[j]["score"].ToString()) + Math.Floor(tmp * 10) * Math.Floor(tmp * 10) * 5;
                            }

                            tmp  = Convert.ToDouble(m_answer.Rows[j]["commcount"].ToString()) * Convert.ToDouble(m_answer.Rows.Count) / Convert.ToDouble(totalcomm);
                            tmp -= 1;
                            if (tmp > 0)
                            {
                                m_answer.Rows[j]["score"] = int.Parse(m_answer.Rows[j]["score"].ToString()) + Math.Floor(tmp * 10) * Math.Floor(tmp * 10) * 3;
                            }
                        }

                        TransactionOptions options = new TransactionOptions();
                        options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
                        options.Timeout        = TransactionManager.DefaultTimeout;

                        using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
                        {
                            m_answer.DefaultView.Sort = "award asc, score desc";
                            DataTable dtTemp = m_answer.DefaultView.ToTable();
                            if (dtTemp.Rows.Count == 1)
                            {
                                QA_AnswerBll.GetInstance().SetAward(QA_AnswerBll.GetInstance().GetModel(int.Parse(dtTemp.Rows[0]["SysNo"].ToString())), QA_QuestionBll.GetInstance().GetModel(int.Parse(m_dt.Rows[i]["SysNo"].ToString())), int.Parse(m_dt.Rows[i]["Award"].ToString()) - QA_AnswerBll.GetInstance().GetUsedAward(int.Parse(dtTemp.Rows[0]["SysNo"].ToString())));
                            }
                            else
                            {
                                int awardremain = int.Parse(m_dt.Rows[i]["Award"].ToString()) - QA_AnswerBll.GetInstance().GetUsedAward(int.Parse(dtTemp.Rows[0]["SysNo"].ToString()));
                                int award1      = awardremain * int.Parse(m_dt.Rows[0]["score"].ToString()) / (int.Parse(m_dt.Rows[0]["score"].ToString()) + int.Parse(m_dt.Rows[1]["score"].ToString()));
                                int award2      = awardremain - award1;
                                QA_AnswerBll.GetInstance().SetAward(QA_AnswerBll.GetInstance().GetModel(int.Parse(dtTemp.Rows[0]["SysNo"].ToString())), QA_QuestionBll.GetInstance().GetModel(int.Parse(m_dt.Rows[i]["SysNo"].ToString())), award1);
                                QA_AnswerBll.GetInstance().SetAward(QA_AnswerBll.GetInstance().GetModel(int.Parse(dtTemp.Rows[1]["SysNo"].ToString())), QA_QuestionBll.GetInstance().GetModel(int.Parse(m_dt.Rows[i]["SysNo"].ToString())), award2);
                            }

                            USR_MessageMod m_notice = new USR_MessageMod();
                            m_notice.CustomerSysNo = int.Parse(m_dt.Rows[i]["CustomerSysNo"].ToString());
                            m_notice.Title         = AppConst.AutoSendAward.Replace("@url", Container.ConfigService.GetAppSetting <string>("HomeUrl", "") + "Quest/Question.aspx?id=" + m_dt.Rows[i]["SysNo"].ToString())
                                                     .Replace("@question", m_dt.Rows[i]["Title"].ToString());
                            m_notice.DR      = 0;
                            m_notice.IsRead  = 0;
                            m_notice.Context = "";
                            m_notice.TS      = DateTime.Now;
                            m_notice.Type    = (int)AppEnum.MessageType.notice;
                            USR_MessageBll.GetInstance().AddMessage(m_notice);

                            scope.Complete();
                            //EventLog.WriteEntry("Hi,I'm wiseman");
                        }
                    }
                }
                LogService.Info("任务结束", LogInfoCategory);
            }
            catch (Exception ex)
            {
                LogService.Error("RewardTask 任务失败", LogInfoCategory);
                LogService.Error(ex, LogInfoCategory);
            }
            finally
            {
                this.NextExecuteTime = DateTime.Now.AddHours(1);
            }
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
        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);
        }
Esempio n. 12
0
        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);
        }