예제 #1
0
 public bool modifyTime(Model.Time time, out string msg)
 {
     if (t.Update_time(time))
     {
         msg = "提交成功";
         return(true);
     }
     else
     {
         msg = "提交失败"; return(false);
     }
 }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Model.Time time = new Model.Time();
            time.D1 = d1.Value;
            time.D2 = d2.Value;
            time.D3 = d3.Value;
            time.D4 = d4.Value;
            BLL.Time b_time = new BLL.Time();
            string   msg    = "";

            if (b_time.modifyTime(time, out msg))
            {               //MessageBox.Show(msg);
            }
            MessageBox.Show(msg);
        }
예제 #3
0
        public bool Update_time(Model.Time time)
        {
            string sql = "update commit_time set start_write = @c1,stop_write = @c2 , start_admission = @c3 , stop_admission = @c4 where id = 1";

            SqlParameter[] paras = new SqlParameter[]
            {
                new SqlParameter("@c1", time.D1),
                new SqlParameter("@c2", time.D2),
                new SqlParameter("@c3", time.D3),
                new SqlParameter("@c4", time.D4)
            };
            int i = SqlDbHelper.ExecuteNonQuery(sql.ToString(), CommandType.Text, paras);

            if (i == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }