using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
namespace Com.Jpsoft.Hospital.Web.Module.ExamineInfo.SORIS
{
public partial class Listp : Com.Jpsoft.Hospital.Web.Common.BasePage
{
protected override void OnInit(EventArgs e)
{
if (!IsPostBack)
{
base.AutoCheckRight = false;
base.CheckRightParam = Com.Jpsoft.Hospital.Web.Common.PageFuntionType.List;
}
base.OnInit(e);
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int curpage = 1;
int id = 0;
AspNetPager1.CurrentPageIndex = curpage;
AspNetPager1.RecordCount = AspNetPager1.PageSize * curpage;
BindPageData();
}
}
private void BindPageData()
{
string strWhere = " where 1=1 and IsProcess=0 ";
int recordCount = 0;
string strOrder = " order by PraiseTime DESC";
using (IDataReader idr = Com.Jpsoft.Hospital.DAL.ts_PraiseRecord.SelectPage(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, strWhere, strOrder))
{
if (idr.Read())
{
recordCount = Convert.ToInt32(idr["RecordCount"]);
}
AspNetPager1.RecordCount = recordCount;
idr.NextResult();
this.GridView1.DataSource = idr;
this.GridView1.DataBind();
}
}
protected void Unnamed1_Click(object sender, EventArgs e)
{
int uid = Convert.ToInt32(txtUID.Text);
Com.Jpsoft.Hospital.BLL.ts_PraiseRecord bll = new BLL.ts_PraiseRecord();
Com.Jpsoft.Hospital.Model.ts_PraiseRecord model = bll.GetModel(uid);
model.UID = uid;
model.Context = txtContext.Text.Trim();
model.IsProcess = true;
model.Linkman = txtLinkman.Text.Trim();
model.Linktime = Convert.ToDateTime(txtLinktime.Text.Trim());
try
{
bll.UpdateViews(model);
Response.Write("");
}
catch (Exception ex)
{
Response.Write("");
}
}
public string GetBoolCN(object obj)
{
bool bl;
if (bool.TryParse(obj.ToString(), out bl))
{
if (bl)
return "是";
}
return "否";
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
BindPageData();
}
}
}