예제 #1
0
        protected void AddValue(object sender, EventArgs e)
        {

            CommonDao<Safezhuan> newmgr = new CommonDao<Safezhuan>();
            Safezhuan safezhuan = new Safezhuan();
            safezhuan.ZhuanName = this.TextBoxName.Text.Trim().ToString();


            int count =int.Parse(newmgr.GetTotalCount("zhuanname='"+safezhuan.ZhuanName.ToString()+"'"));
            if (count == 0)
            {

                if (newmgr.Add(safezhuan))
                {


                    Alert("热点专题添加成功!");
                    BindGridView();
                }
                else
                {
                    Alert("热点专题添加失败!请重试。");

                }
            }
            else {

                Alert("热点专题名称不能重复。");
            }

        }
예제 #2
0
        private void PageAccess()
        {
            CommonDao<SafePageAccess> Pagemgr = new CommonDao<SafePageAccess>();
            SafePageAccess pa = new SafePageAccess();
            pa.createtime = DateTime.Now.ToString();

            pa.pagename = Request.RawUrl;
            if (Tools.CookieHelper.GetCookie("CN_ID") != null)
            {

                EPReper.BLL.Userinfo UI = new EPReper.BLL.Userinfo();
                string userid = Tools.CookieHelper.GetCookie("CN_ID").ToString();
                pa.userinfo = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString();


            }

            else
            {
                pa.userinfo = "匿名 IP:" + Request.UserHostAddress;
            }

            if (int.Parse(Pagemgr.GetTotalCount(" pagename='" + pa.pagename + "' and userinfo ='" + pa.userinfo + "'")) <= 0)
            {
                Pagemgr.Add(pa);
                CommonDao<SafeNews> newmgr = new CommonDao<SafeNews>();
                SafeNews safenew = newmgr.FindById(Request["fid"].ToString());
                safenew.newskits++;
                newmgr.Update(safenew);

            }

        }
예제 #3
0
        private void PageAccess()
        {
            CommonDao<SafePageAccess> Pagemgr = new CommonDao<SafePageAccess>();
            SafePageAccess pa = new SafePageAccess();
            pa.createtime = DateTime.Now.ToString();

            pa.pagename = Request.RawUrl;
            if (Tools.CookieHelper.GetCookie("username") != null)
                pa.userinfo = Tools.CookieHelper.GetCookie("username").ToString() + " IP:" + Request.UserHostAddress;
            else
                pa.userinfo = "匿名 IP:" + Request.UserHostAddress;

            if (int.Parse(Pagemgr.GetTotalCount(" pagename='" + pa.pagename + "' and userinfo ='" + pa.userinfo + "'")) <= 0)
            {
                Pagemgr.Add(pa);
                CommonDao<SafeBook> newmgr = new CommonDao<SafeBook>();
                SafeBook safebook = newmgr.FindById(Request["fid"].ToString());
                safebook.bookkits++;
                newmgr.Update(safebook);

            }

        }
예제 #4
0
        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;
                }
            }


        }
예제 #5
0
        protected void GetValue(object sender, EventArgs e)
        {
            CommonDao<SafeNews> newmgr = new CommonDao<SafeNews>();
            SafeNews safenew = new SafeNews();

            if (Request.QueryString["fid"] != null)
            {
                safenew = newmgr.FindById(Request.QueryString["fid"].ToString());
            }
            safenew.newstitle = this.Txtctitle.Text.Trim().ToString();

            CommonDao<Safezhuan> sugmgr = new CommonDao<Safezhuan>();
            Safezhuan safezhuan = sugmgr.FindByConditions(" ZhuanName='" + this.DropDownListZhuanTi.Text.Trim().ToString() + "' ");

            if(safezhuan!=null){
                safenew.NewsZhuan = safezhuan.fid.ToString();
            }
            safenew.newscontents = this.TxtNewsContent.InnerText.ToString();

            if (Request.QueryString["Infotype"] != null && Request.QueryString["type"] != null)
            {
                safenew.NewsInfoType = Request.QueryString["Infotype"].ToString();
                safenew.newstype = Request.QueryString["type"].ToString();
            }

            if (safenew.NewsInfoType == "安全新闻")
            {
                GetImg getimg = new GetImg();
                safenew.newspics = getimg.MyGetImgUrl(safenew.newscontents);
                if (safenew.newspics.Length > 0)
                {
                    safenew.newstype = "图片新闻";
                }
            }
            EPReper.BLL.Userinfo UI = new EPReper.BLL.Userinfo();
            string userid = Tools.CookieHelper.GetCookie("CN_ID").ToString();
            string username = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString();
            safenew.createperson = username;
            safenew.createtime = DateTime.Now.ToString();

            if (Request.QueryString["fid"]!= null)
            {
                if (newmgr.Update(safenew))
                {
                    MessageBox.ShowAndRedirect(this, "恭喜您," + safenew.newstype + "修改成功!", "SafeAdmin.aspx?Infotype=" + safenew.NewsInfoType + "&type=" + safenew.newstype + "");
                }
                MessageBox.Show(this, "Sorry," + safenew.newstype + "修改失败!,请您重试!");

            }
            else
            {
                if (newmgr.Add(safenew))
                {
                    MessageBox.ShowAndRedirect(this, "恭喜您," + safenew.newstype + "添加成功!", "SafeAdmin.aspx?Infotype=" + safenew.NewsInfoType + "&type=" + safenew.newstype + "");
                }
                MessageBox.Show(this, "Sorry," + safenew.newstype + "添加失败!,请您重试!");
            }
        }
예제 #6
0
        protected void GetValue(object sender, EventArgs e)
        {
            CommonDao<Model.SafePitFalls> newmgr = new CommonDao<SafePitFalls>();
            SafePitFalls spf = new SafePitFalls();
           
            
            if (Request.QueryString["fid"] != null)
            {
                spf = newmgr.FindById(Request.QueryString["fid"].ToString());
            }
            spf.area = this.TextAreaQuYu.InnerText.Trim().ToString();

            spf.time = this.TextBoxDate.Text.ToString();
            spf.person = this.DropDownListPerson.Text.Trim().ToString();
            spf.pitresult = this.TextAreaJieguo.InnerHtml.Trim().ToString();
            if (this.TextBoxfk.Text.ToString()!="")
            {
                spf.Fine = Int32.Parse(this.TextBoxfk.Text.ToString());
            }
            
            spf.pitsuggestion = this.TextAreaYijian.InnerHtml.Trim().ToString();
            spf.pitcontents = this.TextAreaYinhuan.InnerText.Trim().ToString().Replace("\"", "'");//.Replace("\"", "\"\'\"")
            spf.dept = this.DropDownListDept.Text.ToString();
            spf.createperson = "测试";
            spf.createtime = DateTime.Now.ToString();
            GetImg getimg = new GetImg();
            spf.picurl = getimg.MyGetImgUrl(this.TextAreaYinhuan.InnerText.ToString());
            if (Request.QueryString["fid"] != null)
            {
                if (newmgr.Update(spf))
                {
                    MessageBox.ShowAndRedirect(this, "恭喜您,安全隐患修改成功!", "SafeResAdd.aspx");
                }
                MessageBox.Show(this, "Sorry,安全隐患修改失败!请您重试!");

            }
            else
            {
                if (newmgr.Add(spf))
                {
                    MessageBox.ShowAndRedirect(this, "恭喜您,安全隐患添加成功!", "SafeResAdd.aspx");
                }
                MessageBox.Show(this, "Sorry,安全隐患添加失败!请您重试!");

            }
        }
예제 #7
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("您已经有生效的预约,请进行评价或取消后再进行预约!");

        }
예제 #8
0
        protected void GetValue(object sender, EventArgs e)
        {
            CommonDao<Model.SafeRewards> newmgr = new CommonDao<SafeRewards>();
            SafeRewards srew = new SafeRewards();

            if (Request.QueryString["fid"] != null)
            {
                srew = newmgr.FindById(Request.QueryString["fid"].ToString());
            }
            srew.area = this.TextAreaQuyu.InnerText.ToString();// this.DropDownListQuyu.Text.Trim().ToString();
            srew.dept = this.DropDownListDept.Text.Trim().ToString();
            srew.person = this.DropDownListPerson.Text.Trim().ToString();
            srew.rewards = int.Parse(this.TextBoxReward.Text.Trim().ToString());
            srew.createtime = DateTime.Now.ToString();

            CommonDao<SafeDeptMoney> moneymgr = new CommonDao<SafeDeptMoney>();
            SafeDeptMoney sm = moneymgr.FindByConditions(" deptname='" + srew.dept + "' and deptyear=datepart(yy,'" + srew.createtime.ToString() + "') ");
            if (sm == null)
            {
                MessageBox.ShowAndRedirect(this, "未对该部门设置初始金额无法进行奖惩,请设置!", "SafeMoney.aspx");
                return;
            }
            
            sm.currentmoney = sm.currentmoney+srew.rewards;
            srew.totals = sm.currentmoney;

            if (Request.QueryString["fid"] != null)
            {
                if( moneymgr.Update(sm)&&newmgr.Update(srew))
                {
                    MessageBox.ShowAndRedirect(this, "恭喜您,安全奖惩修改成功!", "SafeRewAdd.aspx");
                }
                MessageBox.Show(this, "Sorry,安全奖惩修改失败!请您重试!");

            }
            else
            {
                if (moneymgr.Update(sm) && newmgr.Add(srew))
                {
                    MessageBox.ShowAndRedirect(this, "恭喜您,安全奖惩添加成功!", "SafeRewAdd.aspx");
                }
                MessageBox.Show(this, "Sorry,安全奖惩添加失败!请您重试!");

            }
        }
예제 #9
0
        protected void AddValue(object sender, EventArgs e)
        {

            CommonDao<SafeDeptMoney> newmgr = new CommonDao<SafeDeptMoney>();
            SafeDeptMoney safemoney = new SafeDeptMoney();


            safemoney.deptname = this.DropDownListDept.Text.ToString();
            safemoney.deptmoney = int.Parse(this.TextBoxReward.Text.ToString());
            safemoney.currentmoney = safemoney.deptmoney;
            safemoney.deptyear = this.DropDownListYear.Text.ToString();
            safemoney.createtime = DateTime.Now.ToString();

            if (int.Parse(newmgr.GetTotalCount(" deptname='" + safemoney.deptname.ToString() + "' and deptyear='" + safemoney.deptyear.ToString() + "' ")) == 0)
            {

                if (newmgr.Add(safemoney))
                {
                    Alert("部门金额添加成功!");
                    BindGridView();
                }
                else
                {
                    Alert("部门金额添加失败!请重试。");

                }
            }
            else
            {

                Alert("部门已存在,不能再添加!");
            }

        }
예제 #10
0
        protected void GetValue(object sender, EventArgs e)
        {
            CommonDao<Model.SafeDuty> newmgr = new CommonDao<SafeDuty>();
            SafeDuty sduty = new SafeDuty();

            if (Request.QueryString["fid"] != null)
            {
                sduty = newmgr.FindById(Request.QueryString["fid"].ToString());
            }
            sduty.area = this.TextAreaQuyu.InnerText.Replace("\r\n", "").Trim().ToString();
            sduty.areatype = this.TextBoxFenlei.Text.Trim().ToString();
            sduty.dept = this.TextBoxDept.Text.Trim().ToString();
            sduty.deptleader = this.TextBoxDeptLeader.Text.Trim().ToString();
            sduty.isimportant = this.DropDownListImportant.SelectedValue.ToString();
            sduty.time = this.DropDownListYear.Text.ToString();
            sduty.person = this.TextBoxPerson.Text.Trim().ToString();
            

            if (Request.QueryString["fid"] != null)
            {
                if (newmgr.Update(sduty))
                {
                    MessageBox.ShowAndRedirect(this, "恭喜您,安全责任修改成功!", "SafeDuAdd.aspx");
                }
                MessageBox.Show(this, "Sorry,安全责任修改失败!请您重试!");

            }
            else
            {
                if (newmgr.Add(sduty))
                {
                    MessageBox.ShowAndRedirect(this, "恭喜您,安全责任添加成功!", "SafeDuAdd.aspx");
                }
                MessageBox.Show(this, "Sorry,安全责任添加失败!请您重试!");

            }
        }
예제 #11
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 = "";

        }
예제 #12
0
        protected void AddSug(object sender, EventArgs e)
        {
            CommonDao<SafeSuggestion> newmgr = new CommonDao<SafeSuggestion>();
            SafeSuggestion safesug = new SafeSuggestion();
            safesug.sugcontent = this.TextArea1.InnerText.ToString();
            string userid = Tools.CookieHelper.GetCookie("CN_ID").ToString();
            string username = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString();
            safesug.createperson = username;
            safesug.createtime = DateTime.Now.ToString();
            if (newmgr.Add(safesug))
            {
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('安全建议添加成功!')", true);
                this.TextArea1.InnerText = "";
                GetSafeSug();
            }
            else
            {

                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('安全建议添加失败!')", true);
            }

        }