public void UserDateBind() { CommonDao<HealthUserOrder> HealthUserOrdermgr = new CommonDao<HealthUserOrder>(); CommonDao<HealthAdmin> healadminmgr = new CommonDao<HealthAdmin>(); string username = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString(); if (int.Parse(healadminmgr.GetTotalCount(" username='******' and works=2 ")) > 0) { string condition = " userid in('other','" + userid + "') "; if (this.DropDownList1.Text.Trim() != "") { condition = condition + " and userstate='" + this.DropDownList1.Text.ToString() + "'"; } AspNetPager1.RecordCount = int.Parse(HealthUserOrdermgr.GetTotalCount(condition)); Repeater1.DataSource = HealthUserOrdermgr.FindAllByPageDesc(((AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize).ToString(), AspNetPager1.PageSize.ToString(), condition); Repeater1.DataBind(); } else { string condition = " username='******'"; if (this.DropDownList1.Text.Trim() != "") { condition = condition + " and userstate='" + this.DropDownList1.Text.ToString() + "'"; } AspNetPager1.RecordCount = int.Parse(HealthUserOrdermgr.GetTotalCount(condition)); Repeater1.DataSource = HealthUserOrdermgr.FindAllByPageDesc(((AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize).ToString(), AspNetPager1.PageSize.ToString(), condition); Repeater1.DataBind(); } }
private void InfoBind() { string Infotype = Request.QueryString["Infotype"]; string type = Request.QueryString["type"]; if (Infotype == null && type == null) { Infotype = "安全新闻"; } string condition = ""; CommonDao<SafeNews> newmgr = new CommonDao<SafeNews>(); if (Infotype == "安全新闻") { condition = " NewsInfoType = '" + Infotype + "' "; } else { condition = " NewsInfoType = '" + Infotype + "' and NewsType='" + type + "' "; } if (TextBoxSearch.Text.Trim().Length > 0) { condition = condition + " and newstitle like '%" + this.TextBoxSearch.Text.Trim().ToString() + "%'"; } Pager.RecordCount = int.Parse(newmgr.GetTotalCount(condition)); RepeaterPubGG.DataSource = newmgr.FindAllByPageDesc(((Pager.CurrentPageIndex - 1) * Pager.PageSize).ToString(), Pager.PageSize.ToString(), condition); RepeaterPubGG.DataBind(); }
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); } }
private void InfoBind() { CommonDao<SafePitFalls> newmgr = new CommonDao<SafePitFalls>(); string condition = " 1=1 "; if (TextBoxyh.Text.Trim().Length > 0) { condition = condition + " and PitContents like '%" + this.TextBoxyh.Text.Trim().ToString() + "%'"; } if (TextBoxdept.Text.Trim().Length > 0) { condition = condition + " and dept like '%" + this.TextBoxdept.Text.Trim().ToString() + "%'"; } if (TextBoxperson.Text.Trim().Length > 0) { condition = condition + " and person like '%" + this.TextBoxperson.Text.Trim().ToString() + "%'"; } if (TextBoxqy.Text.Trim().Length > 0) { condition = condition + " and Area like '%" + this.TextBoxqy.Text.Trim().ToString() + "%'"; } if (TextBoxtime.Text.Trim().Length > 0) { condition = condition + " and time = '" + this.TextBoxtime.Text.Trim().ToString()+"'"; } Pager.RecordCount = int.Parse(newmgr.GetTotalCount(condition)); RepeaterPubGG.DataSource = newmgr.FindAllByPageDesc(((Pager.CurrentPageIndex - 1) * Pager.PageSize).ToString(), Pager.PageSize.ToString(), condition); RepeaterPubGG.DataBind(); }
public void UserDateBind() { CommonDao<HealthUserOrder> HealthUserOrdermgr = new CommonDao<HealthUserOrder>(); CommonDao<HealthAdmin> healadminmgr = new CommonDao<HealthAdmin>(); string condition = " 1=1 "; if (this.TextBox1.Text.Trim() != "") { condition = condition + " and USERNAME like '%" + this.TextBox1.Text.ToString() + "%'"; } if (this.TextBox2.Text.Trim() != "") { condition = condition + " and STARTTIME >'" + this.TextBox2.Text.ToString() + "'"; } if (this.TextBox3.Text.Trim() != "") { condition = condition + " and STARTTIME <'" + this.TextBox3.Text.ToString() + "'"; } if (this.DropDownList2.Text.Trim() != "") { condition = condition + " and USERDOCTOR ='" + this.DropDownList2.Text.ToString() + "'"; } if (this.DropDownList1.Text.Trim() != "") { condition = condition + " and userstate='" + this.DropDownList1.Text.ToString() + "'"; } AspNetPager1.RecordCount = int.Parse(HealthUserOrdermgr.GetTotalCount(condition)); Repeater1.DataSource = HealthUserOrdermgr.FindAllByPageDesc(((AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize).ToString(), AspNetPager1.PageSize.ToString(), condition); Repeater1.DataBind(); }
private void GetZhuanTiList() { string fid = ""; string condition = ""; if (Request["ZhuanName"] != null) { fid = Request["ZhuanName"].ToString(); CommonDao<Safezhuan> sugmgr = new CommonDao<Safezhuan>(); Safezhuan safezhuan = sugmgr.FindByConditions(" fid='"+fid+"' "); this.lableType.InnerHtml = " <span style='color: #0087ce;'>" +safezhuan.ZhuanName.ToString() + "</span>"; condition = condition + " NewsZhuan ='" + fid + "' "; } CommonDao<SafeNews> newmgr = new CommonDao<SafeNews>(); SafeNews s = new SafeNews(); if (TextBoxSearch.Text.Trim().Length > 0) { condition = condition + " and newstitle like '%" + this.TextBoxSearch.Text.Trim().ToString() + "%'"; } Pager.RecordCount = int.Parse(newmgr.GetTotalCount(condition)); RepeaterPubGG.DataSource = newmgr.FindAllByPageDesc(((Pager.CurrentPageIndex - 1) * Pager.PageSize).ToString(), Pager.PageSize.ToString(), condition); RepeaterPubGG.DataBind(); }
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("热点专题名称不能重复。"); } }
private void CheckOther() { CommonDao<HealthAdmin> healadminmgr = new CommonDao<HealthAdmin>(); string username = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString(); if (int.Parse(healadminmgr.GetTotalCount(" username='******' and works=2 ")) > 0) { this.TextBoxOther.Visible = true; healthother1.Visible = true; } }
public void GetAdmin() { EPReper.BLL.Userinfo UI = new EPReper.BLL.Userinfo(); CommonDao<HealthAdmin> healadminmgr = new CommonDao<HealthAdmin>(); string username = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString(); if (int.Parse(healadminmgr.GetTotalCount(" username='******' ")) > 0) { admins.Visible = true; admins1.Visible = true; admins2.Visible = true; } }
private void InfoBind() { CommonDao<SafeRewards> newmgr = new CommonDao<SafeRewards>(); string condition = " "; if (TextBoxSearch.Text.Trim().Length > 0) { condition = condition + " Area like '%" + this.TextBoxSearch.Text.Trim().ToString() + "%'"; } Pager.RecordCount = int.Parse(newmgr.GetTotalCount(condition)); RepeaterPubGG.DataSource = newmgr.FindAllByPageDesc(((Pager.CurrentPageIndex - 1) * Pager.PageSize).ToString(), Pager.PageSize.ToString(), condition); RepeaterPubGG.DataBind(); }
private void InfoBind() { CommonDao<SafeNews> newmgr = new CommonDao<SafeNews>(); string condition = " NewsInfoType = '安全新闻' "; if (TextBoxSearch.Text.Trim().Length > 0) { condition = condition + " and newstitle like '%" + this.TextBoxSearch.Text.Trim().ToString() + "%'"; } Pager.RecordCount = int.Parse(newmgr.GetTotalCount(condition)); RpNewReplay.DataSource = newmgr.FindAllByPageDesc(((Pager.CurrentPageIndex - 1) * Pager.PageSize).ToString(), Pager.PageSize.ToString(), condition); RpNewReplay.DataBind(); }
private void InfoBind(string dept) { CommonDao<SafePitFalls> newmgr = new CommonDao<SafePitFalls>(); string condition = " datediff (month,time,getdate())=0 "; if (dept.Length > 0) { condition = condition + " and dept like '%" + dept + "%'"; } Pager.RecordCount = int.Parse(newmgr.GetTotalCount(condition)); Repeateryhxx.DataSource = newmgr.FindAllByPageDesc(((Pager.CurrentPageIndex - 1) * Pager.PageSize).ToString(), Pager.PageSize.ToString(), condition); Repeateryhxx.DataBind(); }
protected void btn2_Clik(object sender, CommandEventArgs e) { CommonDao<HealthIPAddress> ipmgr = new CommonDao<HealthIPAddress>(); IList<HealthIPAddress> listhealthip = ipmgr.FindAll(); int count1 = 0; string clientIP = HttpContext.Current.Request.UserHostAddress.ToString(); count1 = int.Parse(ipmgr.GetTotalCount(" style='health' and left(IPAddress, len(IPAddress)-2)='" + ReturnIP(clientIP) + "'")); if (count1 > 0) { Response.Redirect("View/Default.aspx"); } else { MsgShow("对不起,该功能未对您开通。"); } }
private void InfoBind() { string type = "安全公文"; if (Request["type"] != null) { type = Request["type"].ToString(); this.lableType.InnerHtml = " <span style='color: #0087ce;'>" + type + "</span>"; } CommonDao<SafeNews> newmgr = new CommonDao<SafeNews>(); string condition = " NewsInfoType = '安全信息' and newstype ='" + type + "' "; if (TextBoxSearch.Text.Trim().Length > 0) { condition = condition + " and newstitle like '%" + this.TextBoxSearch.Text.Trim().ToString() + "%'"; } Pager.RecordCount = int.Parse(newmgr.GetTotalCount(condition)); RepeaterPubGG.DataSource = newmgr.FindAllByPageDesc(((Pager.CurrentPageIndex - 1) * Pager.PageSize).ToString(), Pager.PageSize.ToString(), condition); RepeaterPubGG.DataBind(); }
public void OrderDataBind() { CommonDao<HealthUserOrder> UserOrderMgr = new CommonDao<HealthUserOrder>(); HealthUserOrder hu = UserOrderMgr.FindById(OrderID); this.Labeldoctor.Text = hu.userdoctor; this.Labeldatetime.Text = hu.userdate.Substring(0, 3) + "  " + hu.usertime; this.Labeldept.Text = hu.userdept; this.Labeluser.Text = hu.username; this.LabelTel.Text = hu.usertel; this.TextAreaDescription.InnerHtml = hu.description == null ? "" : hu.description.Replace("<br>", "\r\n"); CommonDao<HealthScore> HeacthScoreMgr = new CommonDao<HealthScore>(); if (int.Parse(HeacthScoreMgr.GetTotalCount(" ORDERID='" + OrderID + "'")) == 1) { HealthScore hs = HeacthScoreMgr.FindByConditions(" ORDERID='" + OrderID + "'"); this.Ratingliaoxiao.CurrentRating = hs.liaoxiao/4; this.Ratingfuwu.CurrentRating = hs.fuwutaidu/4; this.Ratingjifa.CurrentRating = hs.jifa/4; this.Ratinglidu.CurrentRating = hs.lidao/4; this.Ratingshushidu.CurrentRating = hs.shushidu/4; this.TextAreaScore.InnerHtml = hs.description == null ? "" : hs.description.Replace("<br>", "\r\n"); } }
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); } }
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; } } }
protected void GridViewEmployee_RowDeleting(object sender, GridViewDeleteEventArgs e) { string fid = GridViewEmployee.DataKeys[e.RowIndex].Value.ToString(); CommonDao<SafeDeptMoney> newmgr = new CommonDao<SafeDeptMoney>(); SafeDeptMoney safemoney = newmgr.FindById(fid); CommonDao<SafeRewards> rewardmgr = new CommonDao<SafeRewards>(); int countreward = int.Parse(rewardmgr.GetTotalCount("dept='" + safemoney.deptname + "' and datepart(yy,createtime)='" + safemoney.deptyear + "'")); if (countreward == 0) { if (safemoney != null) { if (newmgr.Del(safemoney)) { Alert("部门金额删除成功!"); BindGridView(); } } } else { Alert("已有部门奖惩记录,无法删除!"); } }
public bool CheckHasOrder(string userid) { CommonDao<HealthUserOrder> UserOrderMgr = new CommonDao<HealthUserOrder>(); int UserOrderCount = int.Parse(UserOrderMgr.GetTotalCount("USERSTATE='已生效' and USERID='" + userid + "'")); if (UserOrderCount == 0) { return true; } return false; }
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("您已经有生效的预约,请进行评价或取消后再进行预约!"); }
protected void Btn_Yuyue(object sender, EventArgs e) { CommonDao<HealthUserOrder> UserOrderMgr = new CommonDao<HealthUserOrder>(); int UserOrderCount = int.Parse(UserOrderMgr.GetTotalCount("USERSTATE='已生效' and USERID='" + userid + "'")); if (UserOrderCount == 0) { Response.Redirect("UserOrder.aspx"); } else { MsgShow("您已经有生效的预约,请进行评价或取消后再进行预约!"); } }
public void UserDateBind() { CommonDao<V_HealthScoreHistory> HealthUserScoremgr = new CommonDao<V_HealthScoreHistory>(); string condition = " 1=1 "; if (this.TextBox1.Text.Trim() != "") { condition = condition + " and USERNAME like '%" + this.TextBox1.Text.ToString() + "%'"; } if (this.TextBox2.Text.Trim() != "") { condition = condition + " and STARTTIME >'" + this.TextBox2.Text.ToString() + "'"; } if (this.TextBox3.Text.Trim() != "") { condition = condition + " and STARTTIME <'" + this.TextBox3.Text.ToString() + "'"; } if (this.DropDownList2.Text.Trim() != "") { condition = condition + " and USERDOCTOR ='" + this.DropDownList2.Text.ToString() + "'"; } if (this.TextBox4.Text.Trim() != "") { string value = this.TextBox4.Text.ToString(); condition = condition + " and ( LIDAO <" + value + " or SHUSHIDU <" + value + " or LIAOXIAO <" + value + " or JIFA <" + value + " or FUWUTAIDU <" + value + ")"; } if (this.TextBox5.Text.Trim() != "") { string value = this.TextBox5.Text.ToString(); condition = condition + " and ( TOTALSUM < " + value + ")"; } //if (this.DropDownList1.Text.Trim() != "") //{ // condition = condition + " and userstate='" + this.DropDownList1.Text.ToString() + "'"; //} AspNetPager1.RecordCount = int.Parse(HealthUserScoremgr.GetTotalCount(condition)); Repeater1.DataSource = HealthUserScoremgr.FindAllByPageDesc(((AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize).ToString(), AspNetPager1.PageSize.ToString(), condition); Repeater1.DataBind(); }
protected void GridViewEmployee_RowDeleting(object sender, GridViewDeleteEventArgs e) { string fid = GridViewEmployee.DataKeys[e.RowIndex].Value.ToString(); CommonDao<Safezhuan> newmgr = new CommonDao<Safezhuan>(); Safezhuan safezhuan = newmgr.FindById(fid); CommonDao<SafeNews> safenewmgr = new CommonDao<SafeNews>(); int count = int.Parse(safenewmgr.GetTotalCount("NewsZhuan='" + fid + "'")); if (count == 0) { if (safezhuan != null) { if (newmgr.Del(safezhuan)) { Alert("热点专题删除成功!"); BindGridView(); } } } else { Alert("有属于该专题的文章,专题不能删除!"); } }
//判断三级部门长以及预约时间段 // 0 可以执行,为1没有权限,为2 已过期 public int checkdept(string fid) { CommonDao<HealthSchedule> HScheduleMgr = new CommonDao<HealthSchedule>(); HealthSchedule Hschedule = HScheduleMgr.FindById(fid); CommonDao<HealthThree> healthreemgr = new CommonDao<HealthThree>(); TimeSpan timespan = DateTime.Parse(Hschedule.endtime).Date - DateTime.Now.Date; string username = UI.GetList("CN_ID = " + userid).Tables[0].Rows[0]["CN_LOGIN"].ToString(); if (DateTime.Parse(Hschedule.endtime) <= DateTime.Now) { return 2; } else { if (int.Parse(healthreemgr.GetTotalCount(" username ='******'")) > 0) { return 0; } else { if (timespan.Days > 1) { return 1; } else { return 0; } } } }
private void InfoBind() { CommonDao<SafePitFalls> newmgr = new CommonDao<SafePitFalls>(); string condition = " "; if (ViewState["con"] == null) { condition = condition = "1!=1"; } else { string allornot = ""; if (ViewState["fulldept"].ToString().Substring(0, 3) == "999") { allornot = "已处理"; } else { allornot = "全部"; } condition = condition + ViewState["con"]; lbusername.Text = "您正在查看的是 " + ViewState["dept"].ToString() + " " + allornot + "的安全隐患 "; } Pager.RecordCount = int.Parse(newmgr.GetTotalCount(condition)); RepeaterPubGG.DataSource = newmgr.FindAllByPageDesc(((Pager.CurrentPageIndex - 1) * Pager.PageSize).ToString(), Pager.PageSize.ToString(), condition); RepeaterPubGG.DataBind(); }
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("部门已存在,不能再添加!"); } }