Example #1
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (label1.Text == "발주 수정")
     {
         OrderService service = new OrderService();
         OrderListVO  vo      = new OrderListVO()
         {
             order_id    = Convert.ToInt32(label1.Tag),
             order_edate = dtpEdate.Text,
             order_count = Convert.ToInt32(nuCount.Value)
         };
         if (service.UpdateOrder(vo) == 1)
         {
             MessageBox.Show("수정 완료");
             this.Close();
         }
     }
     else
     {
         SOService service = new SOService();
         SOListVO  vo      = new SOListVO()
         {
             so_id     = Convert.ToInt32(label1.Tag),
             so_edate  = dtpEdate.Text,
             so_ocount = Convert.ToInt32(nuCount.Value)
         };
         if (service.UpdateSO(vo) == 1)
         {
             MessageBox.Show("수정 완료");
             this.Close();
         }
     }
 }
Example #2
0
        public int UpdateSO(SOListVO vo)
        {
            string sql = "update TBL_SO_MASTER set so_ocount = @so_ocount, so_edate = @so_edate where so_id = @so_id";

            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                try
                {
                    cmd.Parameters.AddWithValue("@so_id", vo.so_id);
                    cmd.Parameters.AddWithValue("@so_ocount", vo.so_ocount);
                    cmd.Parameters.AddWithValue("@so_edate", vo.so_edate);
                    cmd.ExecuteNonQuery();
                    conn.Close();
                    return(1);
                }
                catch (Exception err)
                {
                    string msg = err.Message;
                    return(0);
                }
            }
        }
Example #3
0
        public int UpdateSO(SOListVO vo)
        {
            SODAC dac = new SODAC();

            return(dac.UpdateSO(vo));
        }