Ejemplo n.º 1
0
        public int ShipWait(ShipWaitVO vo)
        {
            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.Connection = conn;
                SqlTransaction trans = conn.BeginTransaction();

                cmd.Transaction = trans;

                try
                {
                    cmd.CommandText = @"insert into TBL_SHIPMENT (so_id, ship_count, ship_uadmin, ship_udate, ship_state) values(@so_id, @ship_count, @ship_uadmin, replace(convert(varchar(10), getdate(), 120), '-', '-'), '검사대기');
                                        update TBL_SO_MASTER set so_deleted = 'Y' where so_id = @so_id";
                    cmd.Parameters.AddWithValue("@so_id", vo.so_id);
                    cmd.Parameters.AddWithValue("@ship_count", vo.ship_count);
                    cmd.Parameters.AddWithValue("@ship_uadmin", LoginVO.user.Name);
                    cmd.ExecuteNonQuery();


                    cmd.CommandText = "insert into TBL_PRODUCT_STOCK (product_id, ps_odate, ps_stock) values (@product_id, replace(convert(varchar(10), getdate(), 120), '-', '-'), @ship_count)";
                    cmd.Parameters.AddWithValue("@product_id", vo.product_id);
                    cmd.ExecuteNonQuery();

                    cmd.CommandText = "insert into TBL_SHIP_CHECKLIST (ship_id) select IDENT_CURRENT('TBL_SHIPMENT')";
                    cmd.ExecuteNonQuery();

                    trans.Commit();
                    conn.Close();
                    return(1);
                }
                catch (Exception err)
                {
                    string msg = err.Message;
                    trans.Rollback();
                    conn.Close();
                    return(0);
                }
            }
        }
Ejemplo n.º 2
0
        public int ShipWait(ShipWaitVO vo)
        {
            ShipmentDAC dac = new ShipmentDAC();

            return(dac.ShipWait(vo));
        }