Exemple #1
0
        protected void DoneClick(object sender, EventArgs e)
        {
            if (DoProc("PROC_UPDATE_ORDERTIME"))
            {
                MsgShow("执行成功!");


                CommonDao<HealthAdmin> healadminmgr = new CommonDao<HealthAdmin>();
                IList<HealthAdmin> listhealthadmin = healadminmgr.FindByCondition(" works=1 ");

                if (listhealthadmin != null)
                {
                    foreach (HealthAdmin healthadmin in listhealthadmin)
                    {
                        UI.AddAmDetail(healthadmin.username, "保健预约", "排班完成");
                    }
                }
                
            }
            else
            {

                MsgShow("执行失败!");
            }

        }
Exemple #2
0
        private void GetInfo()
        {
            CommonDao<SafeNews> newmgr = new CommonDao<SafeNews>();
            CommonDao<SafePinJia> Pinjiamgr = new CommonDao<SafePinJia>();
            SafeNews safenew = newmgr.FindById(Request["fid"].ToString());
            if (safenew == null)
            {
                this.lbtitle.Text = "无法找到该记录,可能已经被删除!";
                return;
            }
            this.lbtitle.Text = safenew.newstitle;
            this.Title = safenew.newstitle + "--安全新闻管理";
            this.lbcontent.Text = safenew.newscontents;
            this.lbAinfo.Text = " &nbsp;&nbsp;作者:" + safenew.createperson + " &nbsp;&nbsp;最后修改:" + safenew.createtime + "  &nbsp;&nbsp;有效访问量:" + safenew.newskits.ToString();

            this.RPMsgs.DataSource = Pinjiamgr.FindByCondition(" masterfid='" + safenew.fid + "'");
            this.RPMsgs.DataBind();

        }
        protected void Btn_OK(object sender, EventArgs e)
        {

            CommonDao<HealthScore> HeacthScoreMgr = new CommonDao<HealthScore>();
            CommonDao<HealthUserOrder> UserOrderMgr = new CommonDao<HealthUserOrder>();
            HealthUserOrder hu = UserOrderMgr.FindById(OrderID);

            CommonDao<HealthSchedule> OrderSchMgr = new CommonDao<HealthSchedule>();
            HealthSchedule hsc = OrderSchMgr.FindById(hu.userschid);

            if (DateTime.Parse(hu.starttime).AddMinutes(45) > DateTime.Now) 
            //if (DateTime.Parse(hsc.endtime) > DateTime.Now) 
            {
                Show("您的保健服务未完成,请您在保健结束后进行评价。结束时间:"+hsc.endtime+"", " ");
                return;
            }

            if (int.Parse(HeacthScoreMgr.GetTotalCount(" ORDERID='" + OrderID + "' ")) == 0)
            {
                HealthScore hs = new HealthScore();
                hs.orderid = OrderID;
                hs.doctor = hu.userdoctor;
                hs.liaoxiao = this.Ratingliaoxiao.CurrentRating*4;
                hs.fuwutaidu = this.Ratingfuwu.CurrentRating * 4;
                hs.jifa = this.Ratingjifa.CurrentRating * 4;
                hs.lidao = this.Ratinglidu.CurrentRating * 4;
                hs.shushidu = this.Ratingshushidu.CurrentRating * 4; 
                hs.totalsum = hs.liaoxiao + hs.fuwutaidu + hs.jifa + hs.lidao + hs.shushidu;

                hs.description = this.TextAreaScore.InnerHtml.Replace("\r\n", "<br>").ToString();


                string userid = Tools.CookieHelper.GetCookie("CN_ID").ToString();
                hs.createperson = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString();

                hs.createtime = DateTime.Now.ToString();
                hu.userstate = "已评价";

                if (UserOrderMgr.Update(hu) && HeacthScoreMgr.Add(hs))
                {
                    //MsgShow("评价成功!");
                    string subject = "保健预约";
                    string content = "保健预约负责人:<br />您好," + hs.createperson + " 预约的(" + hu.userdate + " " + hu.usertime + ")时间段" + hs.doctor + "医生,预约人已于" + DateTime.Now + "对保健服务进行评价,特告知您知晓并跟踪详情。";
                   

                    CommonDao<HealthAdmin> healadminmgr = new CommonDao<HealthAdmin>();
                    IList<HealthAdmin> listhealthadmin = healadminmgr.FindByCondition(" works=0 ");

                    if (listhealthadmin != null)
                    {
                        foreach (HealthAdmin healthadmin in listhealthadmin)
                        {
                            UI.AddAmDetail(healthadmin.username, subject, content);
                        }
                    }

                    Response.Write("<script>alert('评价成功!');window.location='Default.aspx'</script>");
                    return;
                }
                else
                {
                    Show("评价失败", " ");
                    return;
                }

                // Response.Write("<script>alert('评论成功!');window.location='Default.aspx'</script>");
                //MsgShow("预约成功!");
                // Show("恭喜您,您的文章发布成功!", "window.opener=null;window.open('','_self');window.close();");
            }
            else
            {
                HealthScore hs = HeacthScoreMgr.FindByConditions(" ORDERID='" + OrderID + "'");
                hs.liaoxiao = this.Ratingliaoxiao.CurrentRating * 4;
                hs.fuwutaidu = this.Ratingfuwu.CurrentRating * 4;
                hs.jifa = this.Ratingjifa.CurrentRating * 4;
                hs.lidao = this.Ratinglidu.CurrentRating * 4;
                hs.shushidu = this.Ratingshushidu.CurrentRating * 4;
                hs.totalsum = hs.liaoxiao + hs.fuwutaidu + hs.jifa + hs.lidao + hs.shushidu;


                hs.description = this.TextAreaScore.InnerHtml.Replace("\r\n", "<br>").ToString();

                string userid = Tools.CookieHelper.GetCookie("CN_ID").ToString();
                hs.createperson = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString();
                hs.createtime = DateTime.Now.ToString();

                if (HeacthScoreMgr.Update(hs))
                {
                    string subject = "保健预约";
                    string content = "您好,评价成功! " + DateTime.Now;
                    EPReper.BLL.Manager Manager = new EPReper.BLL.Manager();
                    DataTable dtm = Manager.GetList(0, " isadmin = 9 and states =9 ", "id").Tables[0];
                    if (dtm != null)
                    {
                        if (dtm.Rows.Count > 0)
                        {
                            for (int i = 0; i < dtm.Rows.Count; i++)
                            {
                                UI.AddAmDetail(dtm.Rows[i]["username"].ToString(), subject, content);
                            }
                        }
                    }

                    //Show("评价成功!", "window.opener=null;window.open('','_self');window.close();");
                    Response.Write("<script>alert('评价成功!');window.location='Default.aspx'</script>");
                    return;
                }
                else
                {
                    Show("评价失败", " ");
                    return;
                }
            }


        }
Exemple #4
0
        protected void Btn_OK(object sender, EventArgs e)
        {
            CommonDao<HealthUserOrder> UserOrderMgr = new CommonDao<HealthUserOrder>();
            int UserOrderCount = int.Parse(UserOrderMgr.GetTotalCount("USERSTATE='已生效' and USERID='" + userid + "'"));

            CommonDao<HealthSchedule> OrderSchMgr = new CommonDao<HealthSchedule>();
            HealthSchedule hs = OrderSchMgr.FindById(SchedulId);
            HealthUserOrder uo = new HealthUserOrder();
            if (uo.userstate == "已生效")
            {
                Response.Write("<script>alert('预约操作时间超过五分钟,该预约已失效,请重新预约!');window.location='UserOrder.aspx'</script>");
                return;
            }

            if (UserOrderCount == 0)
            {
               
                if (this.TextBoxOther.Text.Trim().Length > 0)
                {
                    uo.userid = "other";
                    uo.username = this.TextBoxOther.Text.Trim().ToString();
                    uo.userdept = this.TextBoxOtherDept.Text.Trim().ToString();

                    int UserOrderCount2 = int.Parse(UserOrderMgr.GetTotalCount(" USERSTATE='已生效' and USERNAME='******'"));
                    if (UserOrderCount2 >0)
                    {
                        MsgShow("" + uo.username + "已经有生效的预约,请进行评价或取消后再进行预约!");
                        return;
                    }
                   
                  
                }
                else
                {
                    uo.userid = userid;
                    uo.username = username;
                    uo.userdept = this.LabelDept.Text.ToString();
                }

                uo.userdoctor = hs.orderdoctor;
                uo.userschid = SchedulId.ToString();
                uo.userstate = "已生效";
                uo.usertel = this.TextBoxTel.Text.ToString();
                uo.usertime = hs.ordertime;
                uo.userdate = hs.orderdate.Substring(0, 3);
                uo.starttime = hs.starttime;//判断预约时间
                uo.createtime = DateTime.Now.ToString();
                uo.description = this.TextAreaXuqiu.InnerHtml.Replace("\r\n", "<br>").ToString();


                HealthUserMsg healmsg = new HealthUserMsg();
                healmsg.username = uo.username;
                healmsg.userdoctor = hs.orderdoctor;
                healmsg.userschid = SchedulId.ToString();
                healmsg.starttime = hs.starttime;
                healmsg.userdate = hs.orderdate.Substring(0, 3);
                healmsg.usertime = hs.starttime;
                healmsg.createtime = DateTime.Now.ToString();
                healmsg.sendstate = 0;
                CommonDao<HealthUserMsg> healthmsgMgr = new CommonDao<HealthUserMsg>();
                //增加记录
                healthmsgMgr.Add(healmsg);

                hs.isorder = 1;
                hs.orderperson = uo.username;

                if (UserOrderMgr.Add(uo) && OrderSchMgr.Update(hs))
                {

                    string subject = "保健预约";
                    string content = "保健预约负责人:<br />您好," + uo.username + " 已成功预约(" + hs.orderdate.Substring(0, 3) + " " + hs.ordertime + ")时间段 " + hs.orderdoctor + " 医师,特告知您知晓并跟踪详情。";

                    CommonDao<HealthAdmin> healadminmgr = new CommonDao<HealthAdmin>();
                    IList<HealthAdmin> listhealthadmin = healadminmgr.FindByCondition(" works=0 ");

                    if (listhealthadmin != null)
                    {
                        foreach (HealthAdmin healthadmin in listhealthadmin)
                        {
                            UI.AddAmDetail(healthadmin.username, subject, content);
                          // UI.AddAmDetail("盛绍华", subject, content);
                        }
                    }
                    Response.Write("<script>alert('预约成功!');window.location='Default.aspx'</script>");

                }
                else
                {
                    MsgShow("预约失败!");
                    return;
                }
            }

            MsgShow("您已经有生效的预约,请进行评价或取消后再进行预约!");

        }
Exemple #5
0
        //取消预约
        protected void btnCancel_Clik(object sender, CommandEventArgs e)
        {
            string fid = e.CommandName;
            CommonDao<HealthUserOrder> HealthUserOrdermgr = new CommonDao<HealthUserOrder>();
            HealthUserOrder healthorder = HealthUserOrdermgr.FindById(fid);
            if (healthorder.userstate == "已评价")
            {
                MsgShow("预约已评价,无法取消!");
                UserDateBind();
                return;
            }

            healthorder.userstate = "已取消";

        

            //更新排班表
            // HealthSchedule hs = HealthSchedulmgr.FindById(healthorder.userschid);
            //判断 情况  第二周去评价第一周预约的 不能影响第二周的排班
            CommonDao<HealthSchedule> HealthSchedulmgr = new CommonDao<HealthSchedule>();
            HealthSchedule hs = HealthSchedulmgr.FindByConditions(" fid='" + healthorder.userschid + "' and  starttime='" + healthorder.starttime.ToString() + "'");
            //在排班表里面没有了预约
            if (hs == null)
            {
                HealthUserOrdermgr.Update(healthorder);
                MsgShow("成功取消预约");
                UserDateBind();
                return;
            }


            //当前时间大于预约开始时间
            if (DateTime.Now > DateTime.Parse(healthorder.starttime))
            {
                MsgShow("您的保健服务已超过时间,不能取消,请评价。");
                return;
            }


            //更新排班表 和 预约单的状态
            hs.orderperson = "";
            hs.isorder = 0;
            hs.islock = 0;


            //正常取消预约的情况
            if (HealthUserOrdermgr.Update(healthorder) && HealthSchedulmgr.Update(hs))
            {
                //取消小翅膀信息发送
                CommonDao<HealthUserMsg> healthmsgMgr = new CommonDao<HealthUserMsg>();
                HealthUserMsg hwalmsg = healthmsgMgr.FindByConditions(" USERSCHID='" + healthorder.userschid + " ' and starttime='" + healthorder.starttime.ToString() + "'");
                if (hwalmsg != null)
                {
                    hwalmsg.sendstate = 1;
                    healthmsgMgr.Update(hwalmsg);
                }

                //判断是否失效并发送给袁瑛
                if (DateTime.Parse(hs.starttime) > DateTime.Now)
                {
                    string subject = "保健预约取消";
                    string content = "保健预约负责人:<br /> 您好," + healthorder.username + "预约的(" + hs.orderdate.Substring(0, 3) + " " + hs.ordertime + ")时间段 " + hs.orderdoctor + " 医师,预约人已于 " + DateTime.Now + " 取消保健服务预约,特告知您知晓并跟踪详情。 ";
                    // EPReper.BLL.Manager Manager = new EPReper.BLL.Manager();
                    // DataTable dtm = Manager.GetList(0, " isadmin = 9 and states =9 ", "id").Tables[0];

                    CommonDao<HealthAdmin> healadminmgr = new CommonDao<HealthAdmin>();
                    IList<HealthAdmin> listhealthadmin = healadminmgr.FindByCondition(" works=0 ");

                    if (listhealthadmin != null)
                    {

                        foreach (HealthAdmin healthadmin in listhealthadmin)
                        {
                            UI.AddAmDetail(healthadmin.username, subject, content);
                            //UI.AddAmDetail("盛绍华", subject, content);
                        }

                    }

                }

                MsgShow("成功取消预约");
                UserDateBind();
            }
            else
            {
                MsgShow("取消预约失败!");
            }
        }
Exemple #6
0
        protected void ImgBtnMsg_Click(object sender, ImageClickEventArgs e)
        {
            if (this.TxtUserMsgs.Text.Trim().Length > 0)
            {

                string masterfid = Request["fid"].ToString();
                CommonDao<SafePinJia> Pinjiamgr = new CommonDao<SafePinJia>();
                SafePinJia safepinjia = new SafePinJia();
                safepinjia.masterfid = masterfid;
                safepinjia.createtime = DateTime.Now.ToString();
                safepinjia.msgs = this.TxtUserMsgs.Text.Trim().ToString();
                if (Tools.CookieHelper.GetCookie("CN_ID") != null)
                {
                    EPReper.BLL.Userinfo UI = new EPReper.BLL.Userinfo();
                    string userid = Tools.CookieHelper.GetCookie("CN_ID").ToString();
                    safepinjia.createperson = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString();
                }
                else
                {
                    safepinjia.createperson = "匿名 IP:" + Request.UserHostAddress;
                }

                if (Pinjiamgr.Add(safepinjia))
                {
                    Alert("恭喜您,评论成功!");
                    this.RPMsgs.DataSource = Pinjiamgr.FindByCondition(" masterfid='" + masterfid + "'");
                    this.RPMsgs.DataBind();
                }
                else
                {
                    Alert("评论失败!");
                }
            }
            else
                Alert("评论内容不能为空!");
            TxtUserMsgs.Text = "";

        }