public int UpdateHomeReportForProcess(HomeReportModel homereport) { SqlParameter[] param = { new SqlParameter("@ID", SqlDbType.VarChar, 18), new SqlParameter("@FinishText", SqlDbType.Text) }; param[0].Value = homereport.ID; param[1].Value = homereport.FinshText; int result = SqlHelp.ExecuteNonQuery("prc_UpdateHomeReportForProcess", CommandType.StoredProcedure, param); return(result); }
public int InsertHomeReport(HomeReportModel homereport) { SqlParameter[] param = { new SqlParameter("@ID", SqlDbType.VarChar, 20), new SqlParameter("@Code", SqlDbType.VarChar, 9), new SqlParameter("@ReportText", SqlDbType.Text), new SqlParameter("@ReportMemo", SqlDbType.Text) }; param[0].Value = homereport.ID; param[1].Value = homereport.Code; param[2].Value = homereport.ReportText; param[3].Value = homereport.ReportMemo; int result = SqlHelp.ExecuteNonQuery("prc_InsertHomeReport", CommandType.StoredProcedure, param); return(result); }
protected void Page_Load(object sender, EventArgs e) { homereport.ID = Request.QueryString["ID"].ToString(); user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) { Response.Redirect("../Login.aspx"); } else { homereport = bll.ShowHomeReportByID(homereport.ID); lbReportText.Text = homereport.ReportText; lbReportDate.Text = homereport.ReportDate.ToString("yyy年MM月dd日"); lbReportMemo.Text = homereport.ReportMemo; } }
protected void Add_Click(object sender, EventArgs e) { HomeReportModel homereport = new HomeReportModel(); homereport.ID = lbID.Text; homereport.Code = user.Code; homereport.ReportText = txtTitle.Text.Trim(); homereport.ReportMemo = txtMemo.Text.Trim(); bool flag = bll.InsertHomeReport(homereport); if (flag) { Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('添加成功');location.href='MyComplaints.aspx';</script>"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('添加失败');</script>"); } }
public List <HomeReportModel> GetHomeReport() { SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetHomeReport", CommandType.StoredProcedure); List <HomeReportModel> list = new List <HomeReportModel>(); while (dr.Read()) { HomeReportModel homereport = new HomeReportModel(); homereport.ID = dr[0].ToString(); homereport.Code = dr[1].ToString(); homereport.ReportDate = Convert.ToDateTime(dr[2]); homereport.ReportText = dr[3].ToString(); homereport.Sign = Convert.ToInt32(dr[4]); homereport.RoomID = dr[5].ToString(); list.Add(homereport); } dr.Close(); return(list); }
protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["ID"].ToString(); user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 0) { Response.Redirect("../Login.aspx"); } else { if (!IsPostBack) { homereport = bll.ShowHomeReportByID(id); lbID.Text = homereport.ID; txtTitle.Text = homereport.ReportText; txtMemo.Text = homereport.ReportMemo; } } }
public HomeReportModel ShowHomeReportByID(string id) { SqlParameter param = new SqlParameter("@ID", SqlDbType.VarChar, 20); param.Value = id; SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetHomeReportByID", CommandType.StoredProcedure, param); HomeReportModel homereport = new HomeReportModel(); dr.Read(); if (dr.HasRows) { homereport.ID = dr[0].ToString(); homereport.ReportText = dr[1].ToString(); homereport.ReportMemo = dr[2].ToString(); homereport.ReportDate = (DateTime)dr[3]; homereport.FinshText = dr[4].ToString(); } dr.Close(); return(homereport); }
public List <HomeReportModel> ShowHomeReportByCode(string code) { SqlParameter param = new SqlParameter("@Code", SqlDbType.VarChar, 20); param.Value = code; SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetHomeReportByCode", CommandType.StoredProcedure, param); List <HomeReportModel> list = new List <HomeReportModel>(); while (dr.Read()) { HomeReportModel homereport = new HomeReportModel(); homereport.ID = dr[0].ToString(); homereport.Code = dr[1].ToString(); homereport.ReportDate = Convert.ToDateTime(dr[2]); homereport.ReportText = dr[3].ToString(); homereport.Sign = Convert.ToInt32(dr[4]); list.Add(homereport); } dr.Close(); return(list); }
public bool UpdateHomeReportForProcess(HomeReportModel homereport) { int result = dal.UpdateHomeReportForProcess(homereport); return(result == 0 ? false : true); }
public bool InsertHomeReport(HomeReportModel homereport) { int result = dal.InsertHomeReport(homereport); return(result == 0 ? false : true); }