Esempio n. 1
0
 public int InsertHomeRepair(HomeRepairModel homerepair)
 {            
     SqlParameter[] param = { new SqlParameter("@ID", SqlDbType.VarChar, 18), new SqlParameter("@Code", SqlDbType.VarChar, 9),
                              new SqlParameter("@RepairText",SqlDbType.Text),new SqlParameter("@RepairMemo",SqlDbType.Text)
                            };
     param[0].Value = homerepair.ID;
     param[1].Value = homerepair.Code;
     param[2].Value = homerepair.RepairText;
     param[3].Value = homerepair.RepairMemo;            
     int result = SqlHelp.ExecuteNonQuery("prc_InsertHomeRepair", CommandType.StoredProcedure, param);            
     return result;
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     homerepair.ID = Request.QueryString["ID"].ToString();
     user = (UserModel)Session["User"];
     if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1)
         Response.Redirect("../Login.aspx");
     else
     {
         homerepair = bll.ShowHomeRepairByID(homerepair.ID);
         lbRepairText.Text = homerepair.RepairText;
         lbRepairDate.Text = homerepair.RepairDate.ToString("yyy年MM月dd日");
         lbRepairMemo.Text = homerepair.RepairMemo;
     }
 }
Esempio n. 3
0
 protected void Add_Click(object sender, EventArgs e)
 {
     HomeRepairModel homerepair = new HomeRepairModel();
     homerepair.ID = lbID.Text;
     homerepair.Code = user.Code;
     homerepair.RepairText = txtTitle.Text.Trim();
     homerepair.RepairMemo = txtMemo.Text.Trim();           
     bool flag=bll.InsertHomeRepair(homerepair);            
     if (flag)
     {
         Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('添加成功');location.href='MyHomeRepair.aspx';</script>");
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('添加失败');</script>");
     }
 }
Esempio n. 4
0
 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)
         {                   
             homerepair = bll.ShowHomeRepairByID(id);                   
             lbID.Text = homerepair.ID;
             txtTitle.Text = homerepair.RepairText;
             txtMemo.Text = homerepair.RepairMemo;
         }
     }
 }
Esempio n. 5
0
 public List<HomeRepairModel> GetHomeRepair()
 {
     SqlDataReader dr = SqlHelp.ExecuteReader("prc_GetHomeRepair", CommandType.StoredProcedure);
     List<HomeRepairModel> list = new List<HomeRepairModel>();
     while (dr.Read())
     {
         HomeRepairModel homerepair = new HomeRepairModel();
         homerepair.ID = dr[0].ToString();
         homerepair.Code = dr[1].ToString();
         homerepair.RepairDate = Convert.ToDateTime(dr[2]);
         homerepair.RepairText = dr[3].ToString();
         homerepair.Sign = Convert.ToInt32(dr[4]);
         homerepair.RoomID = dr[5].ToString();
         list.Add(homerepair);
     }
     dr.Close();
     return list;
 }
Esempio n. 6
0
        public List<HomeRepairModel> ShowHomeRepairByCode(string code)
        {
            SqlParameter param = new SqlParameter("@Code", SqlDbType.VarChar, 20);
            param.Value = code;
            SqlDataReader dr= SqlHelp.ExecuteReader("prc_GetHomeRepairByCode", CommandType.StoredProcedure, param);            
            List<HomeRepairModel> list = new List<HomeRepairModel>();
            while (dr.Read())
            {
                HomeRepairModel homerepair = new HomeRepairModel();
                homerepair.ID = dr[0].ToString();
                homerepair.Code = dr[1].ToString();
                homerepair.RepairDate = Convert.ToDateTime(dr[2]);
                homerepair.RepairText = dr[3].ToString();
                homerepair.Sign = Convert.ToInt32(dr[4]);

                list.Add(homerepair);
            }
            dr.Close();
            return list;
        }
Esempio n. 7
0
 public HomeRepairModel ShowHomeRepairByID(string id)
 {
     SqlParameter param = new SqlParameter("@ID", SqlDbType.VarChar, 18);
     param.Value = id;
     SqlDataReader dr= SqlHelp.ExecuteReader("prc_GetHomeRepairByID", CommandType.StoredProcedure, param);           
     HomeRepairModel homerepair= new HomeRepairModel();
     dr.Read();
     if (dr.HasRows)
     {
         homerepair.ID = dr[0].ToString();
         homerepair.RepairText = dr[1].ToString();
         homerepair.RepairMemo = dr[2].ToString();
         homerepair.RepairDate = (DateTime)dr[3];
         homerepair.Varperson = dr[4].ToString();
         homerepair.VarText = dr[5].ToString();
         homerepair.RepairUnit = dr[6].ToString();
         homerepair.OwnerText = dr[7].ToString();
     }
     dr.Close();
     return homerepair;
 }
Esempio n. 8
0
 public int UpdateHomeRepairCheck(HomeRepairModel homerepair)
 {
     SqlParameter[] param = { new SqlParameter("@ID", SqlDbType.VarChar, 18), new SqlParameter("@OwnerText", SqlDbType.Text) };
     param[0].Value = homerepair.ID;
     param[1].Value = homerepair.OwnerText;            
     int result = SqlHelp.ExecuteNonQuery("prc_UpdateHomeRepairCheck", CommandType.StoredProcedure, param);           
     return result;
 }
Esempio n. 9
0
 public int UpdateHomeRepairForProcess(HomeRepairModel homerepair)
 {
     SqlParameter[] param = { new SqlParameter("@ID", SqlDbType.VarChar, 18), new SqlParameter("@Varperson", SqlDbType.VarChar, 20),
                              new SqlParameter("@VarText",SqlDbType.Text),new SqlParameter("@RepairUnit",SqlDbType.VarChar,50)
                            };
     param[0].Value = homerepair.ID;
     param[1].Value = homerepair.Varperson;
     param[2].Value = homerepair.VarText;
     param[3].Value = homerepair.RepairUnit;
     int result = SqlHelp.ExecuteNonQuery("prc_UpdateHomeRepairForProcess", CommandType.StoredProcedure, param);
     return result;
 }
Esempio n. 10
0
 public bool UpdateHomeRepairCheck(HomeRepairModel homerepair)
 {
     int result = dal.UpdateHomeRepairCheck(homerepair);
     return result == 0 ? false : true;
 }
Esempio n. 11
0
 public bool UpdateHomeRepairForProcess(HomeRepairModel homerepair)
 {
     int result = dal.UpdateHomeRepairForProcess(homerepair);
     return result == 0 ? false : true;
 }
Esempio n. 12
0
 public bool InsertHomeRepair(HomeRepairModel homerepair)
 {
     int result = dal.InsertHomeRepair(homerepair);
     return result == 0 ? false : true;
 }